import React, { useState } from 'react';
import { Col, Modal, Button, Row } from '@btri-ui/base';

export default () => {
  const [show, setShow] = useState(false);
  const [show2, setShow2] = useState(false);

  const toShow = () => setShow(true);
  const toClose = () => setShow(false);

  const toShow2 = () => setShow2(true);
  const toClose2 = () => setShow2(false);

  const label =
    '默认宽度的对话框，文本内容最多不超过2行，超过2行使用最大宽度对话框。内容较少，使用小宽度的对话框。';

  return (
    <>
      <Row>
        <Col span={6}>
          <Button type="primary" onClick={toShow}>
            按钮属性
          </Button>
        </Col>
        <Col span={6}>
          <Button type="primary" onClick={toShow2}>
            隐藏底部
          </Button>
        </Col>
      </Row>
      <Modal
        title="按钮属性"
        visible={show}
        onOk={toClose}
        onCancel={toClose}
        okText="提交"
      >
        {label}
      </Modal>
      <Modal title="隐藏底部" visible={show2} onCancel={toClose2} footer={null}>
        <p style={{ marginBottom: 0 }}>{label}</p>
      </Modal>
    </>
  );
};
