"use client"; import { CodeBlock } from "@prototype/components/platform-ui/code-block"; import { Panel, PanelSection } from "@prototype/components/platform-ui/panel"; import { PrototypeComponent } from "@prototype/components/prototypes/prototype-target"; import { cn } from "@prototype/lib/utils"; import type { DesignExplorationContext } from "@prototype/lib/prototypes/design-exploration-types"; function DefaultContextJsonView({ data, compact = false, }: { data: unknown; compact?: boolean; }) { const formatted = typeof data === "string" ? data : JSON.stringify(data, null, 2); return {formatted}; } type PrototypeDesignContextPanelProps = { componentId: string; context: DesignExplorationContext; expanded: boolean; onExpandedChange: (expanded: boolean) => void; layout?: "default" | "sidebar"; }; export function PrototypeDesignContextPanel({ componentId, context, expanded, onExpandedChange, layout = "default", }: PrototypeDesignContextPanelProps) { const isSidebar = layout === "sidebar"; const panelId = context.panelId ?? `${componentId}-context-panel`; return (
{context.render ? ( context.render(context.data) ) : ( )}
); }