import DatePicker2 from '..';
import Radio from '../../radio';
import React from 'react';
import ReactDOM from 'react-dom';

const { useState } = React;
const RadioGroup = Radio.Group;

const dataSource = [
  {
    value: 'large',
    label: 'Large',
  }, {
    value: 'medium',
    label: 'Medium',
  }, {
    value: 'small',
    label: 'Small',
  },
];
const { RangePicker } = DatePicker2;


function Demo() {
  const [ size, setSize ] = useState('medium');
  const onChange = val => console.log(val);

  return (<div>
    <RadioGroup
      shape="button"
      // @ts-ignore
      type="primary"
      defaultValue={size}
      dataSource={dataSource}
      // @ts-ignore
      onChange={v => setSize(v)}/>
    <br /><br />
    <DatePicker2
      // @ts-ignore
      size={size}
      onChange={onChange} />
    <br /><br />
    <RangePicker
      // @ts-ignore
      size={size}
      onChange={onChange} />
    <br /><br />
  </div>);
}

ReactDOM.render(<Demo />, document.getElementById('date-picker2-demo-10'));
