diff --git a/apps/sim/app/workspace/[workspaceId]/integrations/[block]/integration-block-detail-fallback.tsx b/apps/sim/app/workspace/[workspaceId]/integrations/[block]/integration-block-detail-fallback.tsx new file mode 100644 index 00000000000..e634e7806e7 --- /dev/null +++ b/apps/sim/app/workspace/[workspaceId]/integrations/[block]/integration-block-detail-fallback.tsx @@ -0,0 +1,33 @@ +'use client' + +import { ChipLink } from '@sim/emcn' +import { ArrowLeft } from 'lucide-react' + +interface IntegrationBlockDetailFallbackProps { + workspaceId: string +} + +/** + * Suspense fallback for the integration detail page — the back-link chrome + * shown while {@link IntegrationBlockDetail} hydrates. + * + * This MUST be a client component. The lucide `ArrowLeft` passed as `ChipLink`'s + * `leftIcon` is a function, and functions cannot cross the server→client + * boundary as props. Rendering the fallback from the server `page.tsx` directly + * threw a React Server Components error ("Functions cannot be passed directly to + * Client Components") that surfaced as the integrations error boundary. Keeping + * the icon inside a client component avoids the boundary crossing entirely. + */ +export function IntegrationBlockDetailFallback({ + workspaceId, +}: IntegrationBlockDetailFallbackProps) { + return ( +
+
+ + Integrations + +
+
+ ) +} diff --git a/apps/sim/app/workspace/[workspaceId]/integrations/[block]/page.tsx b/apps/sim/app/workspace/[workspaceId]/integrations/[block]/page.tsx index e3472de9b1a..d7765df9eb5 100644 --- a/apps/sim/app/workspace/[workspaceId]/integrations/[block]/page.tsx +++ b/apps/sim/app/workspace/[workspaceId]/integrations/[block]/page.tsx @@ -1,10 +1,9 @@ import { Suspense } from 'react' -import { ChipLink } from '@sim/emcn' -import { ArrowLeft } from 'lucide-react' import type { Metadata } from 'next' import { notFound } from 'next/navigation' import { INTEGRATIONS } from '@/lib/integrations' import { IntegrationBlockDetail } from '@/app/workspace/[workspaceId]/integrations/[block]/integration-block-detail' +import { IntegrationBlockDetailFallback } from '@/app/workspace/[workspaceId]/integrations/[block]/integration-block-detail-fallback' export async function generateMetadata({ params, @@ -28,17 +27,7 @@ export default async function IntegrationBlockPage({ if (!integration) notFound() return ( - -
- - Integrations - -
- - } - > + }> )