1 import type { ChangeEvent } from 'react';
3 import { c } from 'ttag';
5 import Select from '@proton/components/components/select/Select';
6 import { MIME_TYPES } from '@proton/shared/lib/constants';
8 const { DEFAULT, PLAINTEXT } = MIME_TYPES;
12 draftType: MIME_TYPES;
13 onChange: (draftType: MIME_TYPES) => void;
17 const DraftTypeSelect = ({ id, draftType, onChange, loading, ...rest }: Props) => {
19 { text: c('Option').t`Normal`, value: DEFAULT },
20 { text: c('Option').t`Plain text`, value: PLAINTEXT },
23 const handleChange = ({ target }: ChangeEvent<HTMLSelectElement>) => onChange(target.value as MIME_TYPES);
25 return <Select id={id} value={draftType} options={options} disabled={loading} onChange={handleChange} {...rest} />;
28 export default DraftTypeSelect;