"use client";
// The single-site workspace shell. It mounts the corpus data source, the shared
// SearchSession, and the PERSISTENT search bar ABOVE the routed content, then
// renders {children} (the results on `/`, the chat on `/ask`). Because a shared
// layout stays mounted across navigation between its child routes, the bar and
// the committed search survive `/` ⇄ `/ask` — the whole point of the shell.
//
// Hub mode does NOT use this: its layout passes children straight through so the
// self-contained / keep their existing MultiSiteDataProvider
// wiring untouched.
import { PlayerProvider } from "yt-dlp-transcript-common/components/PlayerProvider";
import TranscriptModal from "yt-dlp-transcript-common/components/TranscriptModal";
import PostModal from "yt-dlp-transcript-common/components/PostModal";
import { SingleSiteDataProvider } from "yt-dlp-transcript-common/components/SearchDataContext";
import { SearchSessionProvider } from "yt-dlp-transcript-common/components/SearchSessionContext";
import WorkspaceSearchBar from "yt-dlp-transcript-common/components/WorkspaceSearchBar";
import WorkspaceView, { WorkspaceViewProvider } from "./WorkspaceView";
import WorkspaceNav from "./WorkspaceNav";
export default function SiteWorkspace({
children,
transcriptDownloads,
}: {
children: React.ReactNode;
// From the layout's currentSite() — see WorkspaceLayout.
transcriptDownloads: boolean;
}) {
return (
{/* The view provider wraps BOTH: the [Search|Chat|Split] control is
slotted into the bar's chip row, and the panes it governs live in
WorkspaceView. The routed `children` is each route's intro
chrome, slotted above its pane. */}
{/* This column is the search form's containing block, and that is
load-bearing: the form is `position: sticky` below lg, so it can
only stay pinned for as long as its PARENT is on screen. Both
WorkspaceSearchBar and SearchBar return fragments so the form
lands here directly, beside the results it should stay above.
WorkspaceViewProvider renders no DOM of its own. */}
} />
{children}
{/* Sibling viewer for the social-post corpus (see PostModal.tsx). */}
);
}