Remove payments API routing initialization
[ProtonMail-WebClient.git] / packages / components / containers / addresses / Addresses.tsx
blobb461f43d5fec59fefcbb334e17ef0feceb6e633a
1 import { useAllowAddressDeletion } from '@proton/account/allowAddressDeletion/hooks';
2 import { useUser } from '@proton/account/user/hooks';
3 import type { Organization } from '@proton/shared/lib/interfaces';
5 import AddressesWithMembers from './AddressesWithMembers';
6 import AddressesWithUser from './AddressesWithUser';
8 interface AddressesProps {
9     isOnlySelf?: boolean;
10     organization?: Organization;
11     memberID?: string;
12     hasDescription?: boolean;
15 const Addresses = ({ isOnlySelf, organization, memberID, hasDescription }: AddressesProps) => {
16     const [user] = useUser();
17     const [allowAddressDeletion] = useAllowAddressDeletion();
19     return user.isAdmin && user.hasPaidMail ? (
20         <AddressesWithMembers
21             isOnlySelf={isOnlySelf}
22             user={user}
23             memberID={memberID}
24             organization={organization}
25             allowAddressDeletion={allowAddressDeletion ?? false}
26             hasDescription={hasDescription}
27         />
28     ) : (
29         <AddressesWithUser
30             user={user}
31             allowAddressDeletion={allowAddressDeletion ?? false}
32             hasDescription={hasDescription}
33         />
34     );
37 export default Addresses;