1 import type { MouseEvent } from 'react';
3 import type { LabelDescription } from '@proton/components/components/labelStack/LabelStack';
4 import LabelStack from '@proton/components/components/labelStack/LabelStack';
5 import type { ContactGroup } from '@proton/shared/lib/interfaces/contacts/Contact';
8 contactGroups: ContactGroup[];
11 onDetails: (contactGroupID: string, onCloseContactDetailsModal?: () => void) => void;
13 leftToRight?: boolean;
14 onCloseModal?: () => void;
17 const ContactGroupLabels = ({
26 const labels = contactGroups.reduce((acc: LabelDescription[], contactGroup: ContactGroup) => {
31 name: contactGroup.Name,
32 color: contactGroup.Color,
33 title: contactGroup.Name,
34 onClick: (event: MouseEvent) => {
35 onDetails(contactGroup.ID, onCloseModal);
36 event.stopPropagation();
48 leftToRight={leftToRight}
54 export default ContactGroupLabels;