diff --git a/apps/sim/app/templates/components/template-card.tsx b/apps/sim/app/templates/components/template-card.tsx index 67b8bf71d9..337325b0a7 100644 --- a/apps/sim/app/templates/components/template-card.tsx +++ b/apps/sim/app/templates/components/template-card.tsx @@ -210,6 +210,7 @@ function TemplateCardInner({ isPannable={false} defaultZoom={0.8} fitPadding={0.2} + lightweight /> ) : (
diff --git a/apps/sim/app/workspace/[workspaceId]/templates/components/template-card.tsx b/apps/sim/app/workspace/[workspaceId]/templates/components/template-card.tsx index d0f0bead47..41ae0ba933 100644 --- a/apps/sim/app/workspace/[workspaceId]/templates/components/template-card.tsx +++ b/apps/sim/app/workspace/[workspaceId]/templates/components/template-card.tsx @@ -211,6 +211,7 @@ function TemplateCardInner({ isPannable={false} defaultZoom={0.8} fitPadding={0.2} + lightweight /> ) : ( diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/workflow-preview/workflow-preview-block.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/workflow-preview/workflow-preview-block.tsx new file mode 100644 index 0000000000..5a8cfec4c5 --- /dev/null +++ b/apps/sim/app/workspace/[workspaceId]/w/components/workflow-preview/workflow-preview-block.tsx @@ -0,0 +1,133 @@ +'use client' + +import { memo, useMemo } from 'react' +import { Handle, type NodeProps, Position } from 'reactflow' +import { getBlock } from '@/blocks/registry' + +interface WorkflowPreviewBlockData { + type: string + name: string + isTrigger?: boolean + horizontalHandles?: boolean + enabled?: boolean +} + +/** + * Lightweight block component for workflow previews. + * Renders block header, dummy subblocks skeleton, and handles. + * Respects horizontalHandles and enabled state from workflow. + * No heavy hooks, store subscriptions, or interactive features. + * Used in template cards and other preview contexts for performance. + */ +function WorkflowPreviewBlockInner({ data }: NodeProps