import Radio from '..';
import React from 'react';
import ReactDOM from 'react-dom';
const RadioGroup = Radio.Group;

interface PageStates {
  value: string;
}
class App extends React.Component<{}, PageStates> {
  constructor(props) {
    super(props);

    this.state = {
      value: 'orange',
    };

    this.onChange = this.onChange.bind(this);
  }

  onChange(value) {
    this.setState({
      value,
    });
  }

  render() {
    return (
      <div>
        <span style={{ fontSize: 14 }}>
          <label id="groupId">Choose fruit: </label>
        </span>
        <br />
        <br />
        <RadioGroup
          value={this.state.value}
          onChange={this.onChange}
          aria-labelledby="groupId"
        >
          <Radio id="apple" value="apple">
            Apple
          </Radio>
          <Radio id="watermelon" value="watermelon">
            Watermelon
          </Radio>
          <Radio id="orange" value="orange">
            Orange
          </Radio>
        </RadioGroup>
      </div>
    );
  }
}
ReactDOM.render(<App />, document.getElementById('radio-demo-2'));
