1 import { c } from 'ttag';
3 import { Button } from '@proton/atoms';
4 import type { ModalStateProps } from '@proton/components';
5 import { BasicModal, PrimaryButton, useModalTwoStatic } from '@proton/components';
8 type?: FileThresholdModalType;
13 export type FileThresholdModalType = 'fileNumberTotal' | 'fileSizeTotal';
15 export const FileThresholdModal = ({
19 type = 'fileNumberTotal',
22 }: Props & ModalStateProps) => {
23 const handleCancel = () => {
31 type === 'fileNumberTotal'
32 ? c('Title').t`Performance might be affected`
33 : c('Title').t`Uploading a large file or folder`
35 isOpen={open === undefined ? true : open}
36 onClose={handleCancel}
39 <Button onClick={handleCancel}>{c('Action').t`Cancel`}</Button>
46 {c('Action').t`Upload anyway`}
53 {type === 'fileNumberTotal'
54 ? c('Info').t`Uploading hundreds of files at once may have a performance impact.`
56 .t`For best results, avoid streaming and memory-intensive activities or split your upload into smaller batches.`}
62 export const useFileThresholdModal = () => {
63 return useModalTwoStatic(FileThresholdModal);