import * as React from 'react'; import {translate} from 'react-i18next'; import { Field } from 'redux-form'; import Radio from '@material-ui/core/Radio'; import RadioGroup from '@material-ui/core/RadioGroup'; import FormControlLabel from '@material-ui/core/FormControlLabel'; import FormLabel from '@material-ui/core/FormLabel'; import FormControl from '@material-ui/core/FormControl'; interface IBooleanFilterInternal extends React.ClassAttributes { input: any; label: string; t: any; } class BooleanDimensionFormExtraInternal extends React.Component { private constructor(props, context) { super(props, context); this.state = { value: props.input.value, }; } private handleChange = (event, value) => { const { input } = this.props; this.setState({ value }); input.onChange(value === '3' ? 3 : value === '1' ? 1 : 2); } public componentWillReceiveProps(nextProps) { this.setState({value: nextProps.input.value}); } public render() { const { label, t } = this.props; return (
{ label } } label={ t('common:label.true') } /> } label={ t('common:label.false') } /> } label={ t('common:label.either') } />
); } } interface IBooleanDimensionFormExtra extends React.ClassAttributes { label?: string; t: any; } class BooleanDimensionFormExtra extends React.Component { public render() { const { label, t } = this.props; return (
); } } export default translate()(BooleanDimensionFormExtra);