"use client";
import { PrototypeProvider } from "@prototype/components/prototype-provider";
import { PrototypeTelemetryProvider } from "@prototype/lib/prototypes/telemetry/prototype-telemetry-context";
import { PrototypeWorkspaceProfileProvider } from "@prototype/lib/prototypes/use-workspace-profile";
import type { WorkspaceProfile } from "@prototype/lib/prototypes/workspace-profile";
import { usePathname } from "next/navigation";
import type { ComponentType, ReactNode } from "react";
type PrototypeSiteLayoutClientProps = {
children: ReactNode;
galleryShell: ComponentType<{
children: ReactNode;
sourceDirectoryName?: string;
sourcePath?: string;
debug?: boolean;
workspaceOnboarded?: boolean;
}>;
sourceDirectoryName?: string;
sourcePath?: string;
debug?: boolean;
workspaceOnboarded?: boolean;
workspaceProfile: WorkspaceProfile;
toaster?: ReactNode;
};
export function PrototypeSiteLayoutClient({
children,
galleryShell: GalleryShell,
sourceDirectoryName,
sourcePath,
debug,
workspaceOnboarded,
workspaceProfile,
toaster,
}: PrototypeSiteLayoutClientProps) {
const pathname = usePathname();
const isGalleryRoute =
pathname === "/" ||
pathname.startsWith("/design-system") ||
pathname.startsWith("/agent-instructions") ||
pathname.startsWith("/settings");
if (isGalleryRoute) {
return (
{children}
{toaster}
);
}
return (
{children}
{toaster}
);
}