/**
 * title: "从底部滑出形态（所有规则同以上右滑样式）"
 * description: "设置placement 为 bottom，从底部滑出"
 */
import React, { useState } from 'react';
import { Button } from '@alicloud/console-components';
import SlidePanel from '@alicloud/console-components-slide-panel';

const containerStyle = {
  height: '128px',
  borderRadius: '4px',
  lineHeight: '128px',
  background: '#f6f6f6',
  textAlign: 'center',
} as const;

export default () => {
  const [active, setActive] = useState(false);

  return (
    <>
      <Button
        onClick={() => {
          setActive(true);
        }}
      >
        open
      </Button>
      <SlidePanel
        placement="bottom"
        title="标题 Title"
        isShowing={active}
        width="medium"
        onOk={() => {}}
        onCancel={() => {}}
        cancelText="基础按钮"
        okText="基础按钮"
        onVisibleChange={(v) => {
          setActive(v);
        }}
        onClose={() => {
          setActive(false);
        }}
      >
        <div style={containerStyle}>
          Content Placehoder
        </div>
      </SlidePanel>
    </>
  );
};

