Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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 (
<div className='flex h-full flex-col bg-[var(--bg)]'>
<div className='flex flex-shrink-0 items-center bg-[var(--bg)] px-[16px] pt-[8.5px] pb-[8.5px]'>
<ChipLink href={`/workspace/${workspaceId}/integrations`} leftIcon={ArrowLeft}>
Integrations
</ChipLink>
</div>
</div>
)
}
15 changes: 2 additions & 13 deletions apps/sim/app/workspace/[workspaceId]/integrations/[block]/page.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -28,17 +27,7 @@ export default async function IntegrationBlockPage({
if (!integration) notFound()

return (
<Suspense
fallback={
<div className='flex h-full flex-col bg-[var(--bg)]'>
<div className='flex flex-shrink-0 items-center bg-[var(--bg)] px-[16px] pt-[8.5px] pb-[8.5px]'>
<ChipLink href={`/workspace/${workspaceId}/integrations`} leftIcon={ArrowLeft}>
Integrations
</ChipLink>
</div>
</div>
}
>
<Suspense fallback={<IntegrationBlockDetailFallback workspaceId={workspaceId} />}>
<IntegrationBlockDetail integration={integration} workspaceId={workspaceId} />
</Suspense>
)
Expand Down
Loading