"use client"; import { PrototypeComponent } from "@prototype/components/prototypes/prototype-target"; import { PrototypeDesignBriefPanel } from "@prototype/components/prototypes/prototype-design-brief-panel"; import { Dialog, DialogClose, DialogContent, DialogTitle, } from "@prototype/components/ui/dialog"; import { PROTOTYPE_TOOL_MODAL_CLOSE_CLASS } from "@prototype/components/platform-ui/prototype-tool-dialog"; import useCopyToClipboard from "@prototype/lib/use-copy-to-clipboard"; import { buildBriefOverviewCopyText } from "@prototype/lib/prototypes/design-exploration-types"; import type { DesignExplorationBaselineOption, DesignExplorationBrief, DesignExplorationContext, DesignExplorationMobbin, DesignExplorationVariantOption, DesignExplorationVariantsSection, } from "@prototype/lib/prototypes/design-exploration-types"; import { usePersistedLocalString } from "@prototype/lib/prototypes/use-persisted-local-state"; import type { ReactNode } from "react"; import { X } from "lucide-react"; const MODAL_CHROME_BUTTON_CLASS = PROTOTYPE_TOOL_MODAL_CLOSE_CLASS; type PrototypeDesignBriefModalProps = { open: boolean; onOpenChange: (open: boolean) => void; componentIdPrefix: string; galleryId: string; storageKeyPrefix: string; brief: DesignExplorationBrief; context?: DesignExplorationContext; mobbin?: DesignExplorationMobbin; variantsSection?: DesignExplorationVariantsSection; variant: TVariant; onVariantChange: (variant: TVariant) => void; options: DesignExplorationVariantOption[]; renderers: Record ReactNode>; baseline: DesignExplorationBaselineOption; defaultVariantValue?: TVariant; briefConfigFilePath?: string; }; export function PrototypeDesignBriefModal({ open, onOpenChange, componentIdPrefix, galleryId, storageKeyPrefix, brief, context, mobbin, variantsSection, variant, onVariantChange, options, renderers, baseline, defaultVariantValue, briefConfigFilePath, }: PrototypeDesignBriefModalProps) { const { copy: copyOverview, icon: copyIcon } = useCopyToClipboard(); const { value: title } = usePersistedLocalString( `${storageKeyPrefix}-overview-title`, brief.titleDefault, ); const { value: description } = usePersistedLocalString( `${storageKeyPrefix}-overview-description`, brief.descriptionDefault, ); const effectiveTitle = title.trim() || brief.titleDefault; const effectiveDescription = description.trim() || brief.descriptionDefault; return (
Close
{effectiveTitle}
); }