import React from 'react'; import { useTranslation } from 'react-i18next'; import Icon from '../Icon'; import Typography from '../Typography'; import SliderWithTitle from '../SliderWithTitle'; import SelectBox from '../SelectBox'; import ColorSelector from '../../containers/ColorSelector'; 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 something }, }: 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 }); }} throughPortal /> { setDataState({ opacity: val }); }} /> ); }; export default TextOption;