1 import { c } from 'ttag';
3 import { Button, ButtonLike } from '@proton/atoms';
4 import SettingsLink from '@proton/components/components/link/SettingsLink';
5 import type { ModalProps } from '@proton/components/components/modalTwo/Modal';
6 import ModalTwo from '@proton/components/components/modalTwo/Modal';
7 import ModalTwoContent from '@proton/components/components/modalTwo/ModalContent';
8 import ModalTwoFooter from '@proton/components/components/modalTwo/ModalFooter';
9 import ModalTwoHeader from '@proton/components/components/modalTwo/ModalHeader';
10 import type { Member, UserModel } from '@proton/shared/lib/interfaces';
11 import { getMemberEmailOrName } from '@proton/shared/lib/keys/memberHelper';
13 import AdministratorList from './AdministratorList';
15 interface Props extends Omit<ModalProps, 'buttons' | 'title' | 'children'> {
16 onResetKeys: () => void;
17 disableResetOrganizationKeys: boolean;
18 otherAdminsWithKeyAccess: Member[];
22 const ReactivatePasswordlessOrganizationKey = ({
24 otherAdminsWithKeyAccess,
25 disableResetOrganizationKeys,
30 <ModalTwo open {...rest}>
31 <ModalTwoHeader title={c('Title').t`Restore administrator privileges`} {...rest} />
34 if (otherAdminsWithKeyAccess.length) {
37 <div className="mb-4">
39 .t`Use a data recovery method, contact another administrator, or reset the organization key to restore administrator privileges.`}
43 members={otherAdminsWithKeyAccess.map((member) => ({
45 email: getMemberEmailOrName(member),
47 expandByDefault={true}
54 <div>{c('passwordless')
55 .t`Use a data recovery method or reset the organization key to restore administrator privileges.`}</div>
60 <Button onClick={rest.onClose}>{c('Action').t`Close`}</Button>
69 >{c('Action').t`Reset keys`}</Button>
71 <ButtonLike color="norm" as={SettingsLink} path="/recovery" onClick={rest.onClose}>
72 {c('Action').t`Recover data`}
81 export default ReactivatePasswordlessOrganizationKey;