Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / components / containers / forward / ConfirmDeleteForwarding.tsx
blob42f1fe5dfd4cac39892353c354c1482f648b668c
1 import { c } from 'ttag';
3 import { Button } from '@proton/atoms';
4 import type { ModalProps } from '@proton/components/components/modalTwo/Modal';
5 import Prompt from '@proton/components/components/prompt/Prompt';
6 import { useLoading } from '@proton/hooks';
8 interface Props {
9     reActivateE2EE: boolean;
10     modalProps: ModalProps;
11     onDelete: () => Promise<void>;
12     onClose: () => void;
15 const ConfirmDeleteForwarding = ({ reActivateE2EE, onDelete, onClose, modalProps }: Props) => {
16     const [loading, withLoading] = useLoading();
18     return (
19         <Prompt
20             title={c('email_forwarding_2023: Title').t`Delete forwarding?`}
21             buttons={[
22                 <Button color="danger" loading={loading} onClick={() => withLoading(onDelete())}>{c(
23                     'email_forwarding_2023: Action'
24                 ).t`Delete`}</Button>,
25                 <Button autoFocus onClick={onClose}>{c('email_forwarding_2023: Action').t`Cancel`}</Button>,
26             ]}
27             {...modalProps}
28         >
29             <p>
30                 <span className="mr-1">{c('email_forwarding_2023: Prompt')
31                     .t`Forwarding to the destination address will end.`}</span>
32                 {reActivateE2EE ? (
33                     <span>{c('email_forwarding_2023: Prompt')
34                         .t`End-to-end encryption will be re-enabled for the sender address.`}</span>
35                 ) : null}
36             </p>
37         </Prompt>
38     );
41 export default ConfirmDeleteForwarding;