import { useRef } from 'react'; import { SendHorizontal, Square, X, Paperclip, FileText, Film, Music, FileArchive, File, Loader2, AtSign } from 'lucide-react'; import type { AttachedFileMeta } from '../../shared/chat-model'; import { useI18n } from '../../i18n'; type ChatComposerProps = { value: string; isSending: boolean; attachments: AttachedFileMeta[]; error?: string | null; onChange: (value: string) => void; onSend: () => void; onStop: () => void; onAttach: (files: File[]) => void | Promise; onRemoveAttachment: (index: number) => void; onDismissError?: () => void; }; export default function ChatComposer({ value, isSending, attachments, error, onChange, onSend, onStop, onAttach, onRemoveAttachment, onDismissError, }: ChatComposerProps) { const fileInputRef = useRef(null); const { t } = useI18n(); return (
{error ? (
{error} {onDismissError ? ( ) : null}
) : null}