let { ChoiceGroup, IChoiceGroupOption, Fabric } = window.Fabric;

interface IChoiceGroupBasicExampleState {
  imageKey: string;
}

class ChoiceGroupBasicExample extends React.Component<{}, IChoiceGroupBasicExampleState> {
  constructor(props: {}) {
    super(props);

    this.state = {
      imageKey: ''
    };
  }

  public render() {
    return (
      <div>
        <ChoiceGroup
          className="defaultChoiceGroup"
          defaultSelectedKey="B"
          options={[
            {
              key: 'A',
              text: 'Option A',
              'data-automation-id': 'auto1'
            } as IChoiceGroupOption,
            {
              key: 'B',
              text: 'Option B'
            },
            {
              key: 'C',
              text: 'Option C',
              disabled: true
            },
            {
              key: 'D',
              text: 'Option D',
              disabled: true
            }
          ]}
          onChange={this._onChange}
          label="Pick one"
          required={true}
        />
      </div>
    );
  }

  private _onChange = (ev: React.FormEvent<HTMLInputElement>, option: any): void => {
    console.dir(option);
  };
}

ReactDOM.render(<ChoiceGroupBasicExample />, document.getElementById('content'));
