1 import { memo } from 'react';
3 import { c } from 'ttag';
5 import { isEmailNotification } from '@proton/shared/lib/calendar/alarms';
6 import getNotificationString from '@proton/shared/lib/calendar/alarms/getNotificationString';
7 import type { NotificationModel } from '@proton/shared/lib/interfaces/calendar';
10 notification: NotificationModel;
11 formatTime: (date: Date) => string;
13 const PopoverNotification = memo(function PopoverNotificationComponent({ notification, formatTime }: Props) {
14 const str = getNotificationString(notification, formatTime);
15 // translator: the leading string for this can be something like "minutes before" or "at time of event". The UI for an email notification looks like [15] [minutes before by email]
16 const notificationSuffix = c('Notification suffix').t`by email`;
20 {str} {isEmailNotification(notification) ? notificationSuffix : ''}
25 export default PopoverNotification;