import React from 'react'; import { useTranslation } from '../../i18n'; import Icon from '../Icon'; import Typography from '../Typography'; import SliderWithTitle from '../SliderWithTitle'; import ColorSelector from '../ColorSelector'; import SelectBox from '../SelectBox'; import { OptionPropsType, SelectOptionType } from '../../constants/type'; import { Wrapper, Group, Item, } from '../../global/toolStyled'; import { fontOptions, sizeOptions, alignOptions, styleOptions, } from './data'; const TextOption: React.SFC = ({ fontName, fontSize, align, fontStyle, color, opacity, setDataState = (): void => { // do nothing }, }: OptionPropsType) => { const { t } = useTranslation('sidebar'); return ( <> {t('font')} { setDataState({ fontName: option.child }); }} /> { styleOptions.map(ele => ( { setDataState({ fontStyle: ele.child === fontStyle ? '' : ele.child }); }} > )) } {t('size')} { setDataState({ fontSize: option.child }); }} /> {t('align')} { alignOptions.map(ele => ( { setDataState({ align: ele.child }); }} > )) } { setDataState({ color: selected }); }} /> { setDataState({ opacity: val }); }} /> ); }; export default TextOption;