1 import type { ChangeEvent } from 'react';
3 import type { EventModel } from '@proton/shared/lib/interfaces/calendar';
5 const createHandlers = ({
11 setModel: (value: EventModel) => void;
12 field: keyof EventModel;
16 onChange: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>
17 setModel({ ...model, [field]: event.currentTarget.value }),
21 onChange: (value: EventModel[typeof field]) => setModel({ ...model, [field]: value }),
25 export default createHandlers;