Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / components / containers / members / ResendInvitePrompt.tsx
blob75b5e923a6dfc77a8da527a4fee5614bf7430265
1 import { c } from 'ttag';
3 import { Button } from '@proton/atoms';
4 import type { PromptProps } from '@proton/components/components/prompt/Prompt';
5 import Prompt from '@proton/components/components/prompt/Prompt';
6 import getBoldFormattedText from '@proton/components/helpers/getBoldFormattedText';
7 import useLoading from '@proton/hooks/useLoading';
9 interface Props extends Omit<PromptProps, 'title' | 'buttons' | 'children'> {
10     onResend: () => Promise<void>;
11     email: string;
14 const ResendInvitePrompt = ({ onClose, onResend, email, ...rest }: Props) => {
15     const [loading, withLoading] = useLoading();
16     return (
17         <Prompt
18             title={c('Title').t`Send new invite?`}
19             buttons={[
20                 <Button
21                     color="norm"
22                     loading={loading}
23                     onClick={() => {
24                         withLoading(onResend()).then(onClose);
25                     }}
26                 >{c('Action').t`Send new invite`}</Button>,
27                 <Button onClick={onClose}>{c('Action').t`Cancel`}</Button>,
28             ]}
29             onClose={onClose}
30             {...rest}
31         >
32             <p className="text-break">
33                 {getBoldFormattedText(c('Info').t`This will send a new invite to **${email}**.`)}
34             </p>
35         </Prompt>
36     );
39 export default ResendInvitePrompt;