1 import type { ChangeEvent } from 'react';
3 import { c } from 'ttag';
5 import Select from '@proton/components/components/select/Select';
7 import SettingsLayout from '../../../account/SettingsLayout';
8 import SettingsLayoutLeft from '../../../account/SettingsLayoutLeft';
9 import SettingsLayoutRight from '../../../account/SettingsLayoutRight';
10 import { getDurationOptions } from '../../utils';
14 onChange: (duration: number) => void;
17 const DurationField = ({ value, onChange }: Props) => {
18 const handleChange = ({ target }: ChangeEvent<HTMLSelectElement>) => onChange(+target.value);
23 <label htmlFor="duration" className="text-semibold">
24 {c('Label').t`Duration`}
28 <Select id="duration" value={value} onChange={handleChange} options={getDurationOptions()} />
29 </SettingsLayoutRight>
34 export default DurationField;