1 import { c } from 'ttag';
3 import { Button } from '@proton/atoms';
4 import Table from '@proton/components/components/table/Table';
5 import TableBody from '@proton/components/components/table/TableBody';
6 import TableCell from '@proton/components/components/table/TableCell';
7 import TableHeader from '@proton/components/components/table/TableHeader';
8 import TableRow from '@proton/components/components/table/TableRow';
9 import type { ContactEmail } from '@proton/shared/lib/interfaces/contacts';
10 import isTruthy from '@proton/utils/isTruthy';
13 contactEmails: ContactEmail[];
14 onDelete?: (Email: string) => void;
17 const ContactGroupTable = ({ contactEmails, onDelete }: Props) => {
19 <div className="flex flex-column min-h-custom" style={{ '--min-h-custom': '11.25rem' }}>
20 <Table className="border-none">
23 <TableCell type="header">{c('Table header').t`Name`}</TableCell>
24 <TableCell type="header">{c('Table header').t`Address`}</TableCell>
26 <TableCell type="header" className="w-1/5">
27 {c('Table header').t`Action`}
32 {contactEmails.length ? (
34 {contactEmails.map(({ ID, Name, Email }) => {
36 <div className="text-ellipsis max-w-full" key={ID} title={Name}>
39 <div className="text-ellipsis max-w-full" key={ID} title={Email}>
45 onClick={() => onDelete(Email)}
50 {c('Action').t`Remove`}
54 return <TableRow key={ID || Email} cells={cells} />;
60 {!contactEmails.length ? (
61 <div className="flex items-center justify-center min-h-custom" style={{ '--min-h-custom': '9.375rem' }}>
62 {c('Info').t`No contacts added yet`}
69 export default ContactGroupTable;