import Drawer from '..';
import React from 'react';
import ReactDOM from 'react-dom';
import { Button } from '../..';

class Demo extends React.Component {
  state = {
    visible: false,
  };

  onOpen = () => {
    this.setState({
      visible: true,
    });
  };

  onClose = (reason, e) => {
    console.log('onClose: ', reason, e);
    this.setState({
      visible: false,
    });
  };

  render() {
    return (
      <div>
        <Button type="primary" onClick={this.onOpen}
        // @ts-ignore
          style={{ marginRight: '20px' }}> open </Button>
        <Drawer
          title="标题"
          placement="right"
          footer
          // top={24}
          onOk={() => { console.log('okokk'); }}
          onCancel={() => { console.log('notnotnot'); }}
          okProps = "确认提交吗"
          cancelProps = "取消返回吗"
          footerAlign = "right"
          footerActions = {[ 'ok', 'cancel' ]}
          visible={this.state.visible}
          onClose={this.onClose}>
                    Start your business here by searching a popular product
          <div><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>很长的内容</p><p>111</p></div>
        </Drawer>
      </div>
    );
  }
}

ReactDOM.render(<Demo />, document.getElementById('drawer-demo-1'));
