import React, { useRef } from 'react'; import { FileUpload, TooltipAnchor, AttachmentIcon } from '@librechat/client'; import { useLocalize, useFileHandling } from '~/hooks'; import { cn } from '~/utils'; const AttachFile = ({ disabled }: { disabled?: boolean | null }) => { const localize = useLocalize(); const inputRef = useRef(null); const isUploadDisabled = disabled ?? false; const { handleFileChange } = useFileHandling(); return ( { if (!inputRef.current) { return; } if (e.key === 'Enter' || e.key === ' ') { inputRef.current.value = ''; inputRef.current.click(); } }} onClick={() => { if (!inputRef.current) { return; } inputRef.current.value = ''; inputRef.current.click(); }} >
} />
); }; export default React.memo(AttachFile);