Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / applications / drive / src / app / components / modals / DownloadContainsDocumentsModal.tsx
blob323998260892b381225aa01a6e4c34d905cac4b2
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';
6 import { DOCS_APP_NAME, DRIVE_APP_NAME } from '@proton/shared/lib/constants';
8 type Props = {
9     onCancel?: () => void;
10     onSubmit?: () => void;
13 export default function DownloadContainsDocumentsModal({
14     onSubmit,
15     onCancel,
16     onClose,
17     open,
18     ...modalProps
19 }: Props & ModalStateProps) {
20     const handleCancel = () => {
21         onCancel?.();
22         onClose();
23     };
25     return (
26         <BasicModal
27             title={
28                 // translator: Your download has a Proton Docs file
29                 c('Title').t`Your download has a ${DOCS_APP_NAME} file`
30             }
31             isOpen={open === undefined ? true : open}
32             onClose={handleCancel}
33             footer={
34                 <>
35                     <Button onClick={handleCancel}>{c('Action').t`Cancel download`}</Button>
36                     <PrimaryButton
37                         onClick={() => {
38                             onSubmit?.();
39                             onClose();
40                         }}
41                     >
42                         {c('Action').t`Understood`}
43                     </PrimaryButton>
44                 </>
45             }
46             {...modalProps}
47         >
48             <p>{
49                 // translator: Downloading Proton Docs files from Proton Drive is currently not supported (...)
50                 c('Info')
51                     .t`Downloading ${DOCS_APP_NAME} files from ${DRIVE_APP_NAME} is currently not supported — these will not be included in your download.`
52             }</p>
53             <p>{
54                 // translator: Please export them directly from the Proton Docs application (...)
55                 c('Info')
56                     .t`Please export them directly from the ${DOCS_APP_NAME} application instead if you wish to download them.`
57             }</p>
58         </BasicModal>
59     );
62 export const useDownloadContainsDocumentsModal = () => {
63     return useModalTwoStatic(DownloadContainsDocumentsModal);