1 import { Icon } from '@proton/components';
2 import { ICAL_ATTENDEE_STATUS } from '@proton/shared/lib/calendar/constants';
4 const { ACCEPTED, DECLINED, TENTATIVE, DELEGATED, NEEDS_ACTION } = ICAL_ATTENDEE_STATUS;
6 const iconContainerClassName = 'inline-flex rounded-50 items-center justify-center partstatIcon';
7 const iconClassName = '';
9 const IconYes = () => (
10 <span className={`${iconContainerClassName} color-success`}>
11 <Icon name="checkmark-circle-filled" className={iconClassName} size={3} />
14 const IconMaybe = () => (
15 <span className={`${iconContainerClassName} color-warning`}>
16 <Icon name="question-circle-filled" className={iconClassName} size={3} />
19 const IconNo = () => (
20 <span className={`${iconContainerClassName} color-danger`}>
21 <Icon name="cross-circle-filled" className={iconClassName} size={3} />
24 const IconNeedsAction = () => null;
26 export const iconMap = {
29 [TENTATIVE]: IconMaybe,
30 [DELEGATED]: () => null,
31 [NEEDS_ACTION]: IconNeedsAction,
35 partstat: ICAL_ATTENDEE_STATUS;
37 const ParticipantStatusIcon = ({ partstat }: Props) => {
38 if (partstat === ACCEPTED) {
40 <span className={`${iconContainerClassName} color-success`}>
41 <Icon name="checkmark-circle-filled" className={iconClassName} size={4} />
45 if (partstat === TENTATIVE) {
47 <span className={`${iconContainerClassName} color-warning`}>
48 <Icon name="question-circle-filled" className={iconClassName} size={4} />
52 if (partstat === DECLINED) {
54 <span className={`${iconContainerClassName} color-danger`}>
55 <Icon name="cross-circle-filled" className={iconClassName} size={4} />
59 if (partstat === NEEDS_ACTION) {
65 export default ParticipantStatusIcon;