Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / applications / drive / src / app / components / sections / Drive / ToolbarButtons / UploadFileButton.tsx
blobd3f16f50b07a891717e562cc85fd1d523d48c445
1 import { c } from 'ttag';
3 import { Icon, ToolbarButton } from '@proton/components';
5 import { useActiveShare } from '../../../../hooks/drive/useActiveShare';
6 import { useFileUploadInput } from '../../../../store';
8 const UploadFileButton = () => {
9     const { activeFolder } = useActiveShare();
10     const {
11         inputRef: fileInput,
12         handleClick,
13         handleChange,
14     } = useFileUploadInput(activeFolder.shareId, activeFolder.linkId);
16     return (
17         <>
18             <input multiple type="file" ref={fileInput} className="hidden" onChange={handleChange} />
19             <ToolbarButton
20                 data-testid="toolbar-upload-file"
21                 icon={<Icon name="file-arrow-in-up" alt={c('Action').t`Upload file`} />}
22                 title={c('Action').t`Upload file`}
23                 onClick={handleClick}
24             />
25         </>
26     );
29 export default UploadFileButton;