import type { ReactNode } from "react"; import { SidebarShell } from "./SidebarShell"; import { DesignPageAside } from "./DesignPageAside"; import { useScrollbarWhileScrolling } from "./side-panel"; import { FlyoutAppearanceProvider } from "./ui/flyout"; export type DesignPageShellProps = { sidebar: ReactNode; title: string; children: ReactNode; sidebarStorageKey?: string; headerActions?: ReactNode; /** Omit for the two-pane layout. Content scrolls independently of the main pane. */ rightSidebar?: ReactNode; rightSidebarTitle?: string; rightSidebarHeader?: ReactNode; rightSidebarControls?: ReactNode; rightSidebarMaximized?: boolean; rightSidebarStorageKey?: string; }; /** Shared proposed desktop shell. Pages supply content; the shell owns pane geometry and scrolling. */ export function DesignPageShell({ sidebar, title, children, sidebarStorageKey = "paperclip.design-proposal.sidebar-width", headerActions, rightSidebar, rightSidebarTitle = "Details", rightSidebarHeader, rightSidebarControls, rightSidebarMaximized = false, rightSidebarStorageKey = `${sidebarStorageKey}.right`, }: DesignPageShellProps) { const handleMainScroll = useScrollbarWhileScrolling(); const handleAsideScroll = useScrollbarWhileScrolling(); const hasRightSidebar = rightSidebar != null && rightSidebar !== false; const maximized = hasRightSidebar && rightSidebarMaximized; return (
Skip to main content {sidebar}

{title}

{headerActions &&
{headerActions}
}
{children}
{hasRightSidebar &&

{rightSidebarTitle}

{rightSidebarHeader &&
{rightSidebarHeader}
} {rightSidebarControls &&
{rightSidebarControls}
}
{rightSidebar}
}
); }