import Radio from '..';
import Switch from '../../switch';

import React from 'react';
import ReactDOM from 'react-dom';

interface PageStates {
  disabled: boolean;
}
class App extends React.Component<{}, PageStates> {
  toggleDisabled: () => void;
  constructor(props) {
    super(props);
    this.state = {
      disabled: true,
    };
    this.toggleDisabled = () => {
      this.setState({
        disabled: !this.state.disabled,
      });
    };
  }
  render() {
    return (
      <React.Fragment>
        disabled:{' '}
        <Switch
          size="small"
          defaultChecked
          onChange={this.toggleDisabled}
          style={{ verticalAlign: 'middle' }}
        />
        <br />
        <br />
        <br />
        <Radio
          defaultChecked={false}
          disabled={this.state.disabled}
          style={{ marginRight: 10 }}
        >
          Disabled
        </Radio>
        <Radio defaultChecked disabled={this.state.disabled}>
          Disabled
        </Radio>
      </React.Fragment>
    );
  }
}

ReactDOM.render(<App />, document.getElementById('radio-demo-4'));
