Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / applications / calendar / src / app / components / eventModal / inputs / CustomFrequencySelector.tsx
blob2b9a4beafca8d658a8d2cbbb37b4c3e2feb9c368
1 import type { WeekStartsOn } from '@proton/shared/lib/date-fns-utc/interface';
2 import type { DateTimeModel, FrequencyModel } from '@proton/shared/lib/interfaces/calendar';
4 import EndsRow from '../rows/EndsRow';
5 import RepeatEveryRow from '../rows/RepeatEveryRow';
7 interface Props {
8     frequencyModel: FrequencyModel;
9     start: DateTimeModel;
10     displayWeekNumbers: boolean;
11     weekStartsOn: WeekStartsOn;
12     errors: object;
13     isSubmitted: boolean;
14     onChange: (value: FrequencyModel) => void;
15     displayStacked?: boolean;
17 const CustomFrequencySelector = ({
18     frequencyModel,
19     start,
20     displayWeekNumbers,
21     weekStartsOn,
22     errors,
23     onChange,
24     isSubmitted,
25     displayStacked = false,
26 }: Props) => {
27     return (
28         <>
29             <RepeatEveryRow
30                 frequencyModel={frequencyModel}
31                 start={start}
32                 weekStartsOn={weekStartsOn}
33                 onChange={onChange}
34                 errors={errors}
35                 isSubmitted={isSubmitted}
36                 displayStacked={displayStacked}
37             />
38             <EndsRow
39                 frequencyModel={frequencyModel}
40                 start={start}
41                 displayWeekNumbers={displayWeekNumbers}
42                 weekStartsOn={weekStartsOn}
43                 errors={errors}
44                 isSubmitted={isSubmitted}
45                 onChange={onChange}
46                 displayStacked={displayStacked}
47             />
48         </>
49     );
52 export default CustomFrequencySelector;