1 import { c, msgid } from 'ttag';
3 import Collapsible from '@proton/components/components/collapsible/Collapsible';
4 import CollapsibleContent from '@proton/components/components/collapsible/CollapsibleContent';
5 import CollapsibleHeader from '@proton/components/components/collapsible/CollapsibleHeader';
6 import CollapsibleHeaderIconButton from '@proton/components/components/collapsible/CollapsibleHeaderIconButton';
7 import Icon from '@proton/components/components/icon/Icon';
9 export const AdministratorItem = ({ name, email }: { name: string; email: string }) => {
11 <div className="w-full text-ellipsis">
12 <span className="text-bold" title={name}>
15 {email && email !== name && (
16 <span className="color-weak" title={email}>
24 const AdministratorList = ({
28 members?: { member: { Name: string; ID: string }; email: string }[] | null;
29 expandByDefault?: boolean;
31 if (!members?.length) {
35 const n = members.length;
38 <Collapsible expandByDefault={expandByDefault}>
42 <CollapsibleHeaderIconButton size="small" color="norm">
43 <Icon name="chevron-down" />
44 </CollapsibleHeaderIconButton>
47 <label className="color-primary">
48 {c('Label').ngettext(msgid`Show ${n} administrator`, `Show ${n} administrators`, n)}
53 <div className="border border-weak rounded p-2 flex flex-column gap-1">
54 {members.map(({ member, email }) => {
55 return <AdministratorItem key={member.ID} name={member.Name} email={email} />;
63 export default AdministratorList;