import { useEffect, useState } from 'react'; import AgentsDialogSurface from './AgentsDialogSurface'; const INPUT_CLASS_NAME = [ 'h-[44px] w-full rounded-xl border border-black/10 bg-white px-7', 'text-[22px] text-[#171717] outline-none transition-colors placeholder:text-[#9A958C]', 'focus:border-black/20 dark:border-white/10 dark:bg-[#222225] dark:text-[#f3f4f6] dark:placeholder:text-gray-500', ].join(' '); type AddAgentDialogCopy = { title: string; subtitle: string; nameLabel: string; namePlaceholder: string; inheritWorkspaceLabel: string; inheritWorkspaceDescription: string; cancelLabel: string; saveLabel: string; savingLabel: string; }; type AddAgentDialogProps = { open: boolean; saving: boolean; copy: AddAgentDialogCopy; onClose: () => void; onSave: (input: { name: string; inheritWorkspace: boolean }) => Promise | void; }; function Toggle({ checked, disabled, onToggle, }: { checked: boolean; disabled: boolean; onToggle: () => void; }) { return ( ); } export default function AddAgentDialog({ open, saving, copy, onClose, onSave, }: AddAgentDialogProps) { const [name, setName] = useState(''); const [inheritWorkspace, setInheritWorkspace] = useState(false); useEffect(() => { if (!open) return; setName(''); setInheritWorkspace(false); }, [open]); const canSave = name.trim().length > 0 && !saving; return (
setName(event.target.value)} placeholder={copy.namePlaceholder} className={INPUT_CLASS_NAME} autoFocus />
{copy.inheritWorkspaceLabel}

{copy.inheritWorkspaceDescription}

setInheritWorkspace((current) => !current)} />
); }