1 import { c } from 'ttag';
3 import { Button } from '@proton/atoms';
4 import Prompt from '@proton/components/components/prompt/Prompt';
5 import type { PromptProps } from '@proton/components/components/prompt/Prompt';
6 import { useLoading } from '@proton/hooks';
7 import { BRAND_NAME } from '@proton/shared/lib/constants';
9 interface Props extends Omit<PromptProps, 'title' | 'children' | 'buttons'> {
11 onDisable: () => Promise<void>;
14 const DisableAddressModal = ({ email, onDisable, ...rest }: Props) => {
15 const [loading, withLoading] = useLoading();
17 <strong key="address" className="text-break">
23 title={c('Disable address prompt').t`Disable address?`}
25 <Button color="danger" onClick={() => withLoading(onDisable().then(rest.onClose))} loading={loading}>
26 {c('Disable address prompt').t`Disable address`}
28 <Button onClick={rest.onClose} disabled={loading}>{c('Action').t`Cancel`}</Button>,
32 {c('Disable address prompt')
33 .jt`By disabling this address ${address}, you will no longer be able to send or receive emails using this address and all the linked ${BRAND_NAME} products will be disabled.`}
36 {c('Disable address prompt').t`Are you sure you want to disable this address?`}
41 export default DisableAddressModal;