import { useId, type ReactNode } from "react"; import { ChevronDown } from "lucide-react"; import { cn } from "../../app/renderer/lib/utils"; import styles from "./AgentGUIChrome.styles"; /** * Product-neutral composer accessory that expands upward from its persistent * banner. The disclosure trigger and trailing actions are siblings so actions * never become nested interactive controls. */ export function AgentComposerDisclosureCard({ actions, bannerClassName, children, expanded, icon, labels, onExpandedChange, panelClassName, summary, testId, title }: { actions?: ReactNode; /** Extra class applied to the persistent banner card only. */ bannerClassName?: string; children: ReactNode; expanded: boolean; icon: ReactNode; labels: { collapse: string; expand: string; }; onExpandedChange(expanded: boolean): void; /** Extra class applied to the expanded panel surface only. */ panelClassName?: string; summary: string; testId: string; title: string; }): React.JSX.Element { const panelId = useId(); const disclosureLabel = expanded ? labels.collapse : labels.expand; return (
{expanded ? (
{children}
) : null}
{actions ? (
{actions}
) : null}
); }