import { SlidersHorizontal } from "@phosphor-icons/react"; import { Switch } from "../selection/switch"; import { cn } from "../../lib/cn"; export type AIFeatureConfig = { showAttachments: boolean; showMentions: boolean; showMessageActions: boolean; showModels: boolean; showQueue: boolean; showTasks: boolean; showTimestamps: boolean; showToolCalls: boolean; showVoice: boolean; }; export const defaultAIFeatureConfig: AIFeatureConfig = { showAttachments: true, showMentions: true, showMessageActions: true, showModels: true, showQueue: true, showTasks: true, showTimestamps: true, showToolCalls: true, showVoice: false, }; export type AIFeaturePanelProps = { className?: string; onChange?: (config: AIFeatureConfig) => void; title?: string; value?: Partial; }; const featureLabels: { key: keyof AIFeatureConfig; label: string }[] = [ { key: "showAttachments", label: "Attachments" }, { key: "showMentions", label: "Mentions" }, { key: "showTasks", label: "Task modes" }, { key: "showModels", label: "Model selector" }, { key: "showVoice", label: "Voice input" }, { key: "showQueue", label: "Queue steering" }, { key: "showMessageActions", label: "Message actions" }, { key: "showToolCalls", label: "Tool calls" }, { key: "showTimestamps", label: "Message timestamps" }, ]; export function AIFeaturePanel({ className, onChange, title = "AI features", value, }: AIFeaturePanelProps) { const config = { ...defaultAIFeatureConfig, ...value }; function update(key: keyof AIFeatureConfig, checked: boolean) { onChange?.({ ...config, [key]: checked }); } return (

{title}

Toggle experimental AI composer and conversation features independently.

{featureLabels.map((feature) => update(feature.key, checked)} />)}
); }