Spaces:
Build error
Build error
| 'use client'; | |
| import * as React from 'react'; | |
| import { FileBrowser } from '@/components/file-browser'; | |
| import { FileBrowserSkeleton } from '@/components/file-browser-skeleton'; | |
| import type { Folder } from '@/app/api/files/route'; | |
| interface SharePageClientProps { | |
| initialData: Folder | null; | |
| } | |
| export function SharePageClient({ initialData }: SharePageClientProps) { | |
| const [data, setData] = React.useState<Folder | null>(initialData); | |
| // This effect handles cases where the initial data might change or be re-fetched on client, | |
| // though in a server-first pattern it primarily hydrates the initial state. | |
| React.useEffect(() => { | |
| setData(initialData); | |
| }, [initialData]); | |
| if (!data) { | |
| return <FileBrowserSkeleton />; | |
| } | |
| return <FileBrowser initialData={data} isPublicShare />; | |
| } | |