Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / shared / lib / calendar / alarms / modelToValarm.ts
blob22034a858474a89859dfc352874309b9884006c3
1 import type { NotificationModel } from '../../interfaces/calendar';
2 import type { VcalValarmComponent } from '../../interfaces/calendar/VcalModel';
3 import { ICAL_ALARM_ACTION, NOTIFICATION_TYPE_API } from '../constants';
4 import { getValarmTrigger } from './getValarmTrigger';
6 export const modelToValarmComponent = (notificationModel: NotificationModel): VcalValarmComponent => {
7     return {
8         component: 'valarm',
9         trigger: {
10             value: getValarmTrigger(notificationModel),
11         },
12         action: {
13             value:
14                 notificationModel.type === NOTIFICATION_TYPE_API.EMAIL
15                     ? ICAL_ALARM_ACTION.EMAIL
16                     : ICAL_ALARM_ACTION.DISPLAY,
17         },
18     };