Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / components / containers / autoReply / AutoReplyForm / AutoReplyFormDaily.tsx
blobfef73e6ae7ec7d0036b51bc5c0a3c866d0c78033
1 import { c } from 'ttag';
3 import SettingsParagraph from '@proton/components/containers/account/SettingsParagraph';
5 import DaysOfWeekField from './fields/DaysOfWeekField';
6 import TimeField from './fields/TimeField';
7 import TimeZoneField from './fields/TimeZoneField';
8 import type { AutoReplyFormModel } from './interfaces';
10 interface Props {
11     model: AutoReplyFormModel;
12     updateModel: (key: string) => (value: any) => void;
15 const AutoReplyFormDaily = ({ model: { daysOfWeek, start, end, timezone }, updateModel }: Props) => {
16     return (
17         <>
18             <SettingsParagraph>
19                 {c('Info')
20                     .t`Auto-reply is always active on the days of the week you select, between the selected hours.`}
21             </SettingsParagraph>
22             <DaysOfWeekField value={daysOfWeek} onChange={updateModel('daysOfWeek')} />
23             <TimeField
24                 value={start.time}
25                 onChange={updateModel('start.time')}
26                 label={c('Label').t`Start time`}
27                 id="startTime"
28             />
29             <TimeField
30                 value={end.time}
31                 onChange={updateModel('end.time')}
32                 label={c('Label').t`End time`}
33                 id="endTime"
34             />
35             <TimeZoneField value={timezone} onChange={updateModel('timezone')} />
36         </>
37     );
40 export default AutoReplyFormDaily;