import React from 'react'; import { WithTranslation } from 'next-i18next'; import { withTranslation } from '../../i18n'; import { OptionPropsType } from '../../constants/type'; import Typography from '../Typography'; import SelectBox from '../SelectBox'; import SliderWithTitle from '../SliderWithTitle'; import ColorSelector from '../ColorSelector'; import { Wrapper, } from '../../global/toolStyled'; import { shapeOptions, typeOptions, } from './data'; type i18nProps = { t: (key: string) => string; } type Props = i18nProps & OptionPropsType; const ShapeOption: React.SFC = ({ t, shape, color, opacity, width, setDataState = (): void => { // do nothing }, }: Props) => ( <> {t('style')} ): void => { setDataState({ shape: item.key }); }} /> { shape !== 'line' && shape !== 'arrow' && ( ): void => { setDataState({ type: item.key }); }} /> ) } { setDataState({ color: selected }); }} /> { setDataState({ opacity: val }); }} /> { setDataState({ width: val }); }} maximum={40} /> ); const translator = withTranslation('sidebar'); type TransProps = WithTranslation & OptionPropsType; export default translator(ShapeOption);