1 import Option from '@proton/components/components/option/Option';
2 import SelectTwo from '@proton/components/components/selectTwo/SelectTwo';
4 import { DEFAULT_FONT_SIZE, FONT_SIZES } from '../../components/editor/constants';
9 onChange: (value: number) => void;
13 const options = Object.entries(FONT_SIZES).map(([valueInPx]) => {
14 const fontSizeNumber = valueInPx.replace('px', '');
15 return { text: fontSizeNumber, value: parseInt(fontSizeNumber, 10) };
18 const FontSizeSelect = ({ id, fontSize, onChange, loading, ...rest }: Props) => {
19 const isValid = options.some((option) => fontSize === option.value);
20 const fontFaceSize = isValid ? fontSize : DEFAULT_FONT_SIZE;
27 onChange={({ value }) => {
32 {options.map(({ text, value }) => (
33 <Option key={value} value={value} title={text} />
39 export default FontSizeSelect;