import * as React from "react"
import { ComponentStory, ComponentMeta } from "@storybook/react"
import { ExclamationConfirm } from "../src"

export default {
  title: "lib/ExclamationConfirm",
  component: ExclamationConfirm
} as ComponentMeta<typeof ExclamationConfirm>

const Template: ComponentStory<typeof ExclamationConfirm> = () => {
  const [show, setShow] = React.useState(false)

  const onClose = () => setShow(false)

  return (
    <div>
      <button onClick={() => setShow(true)}>显示</button>

      <ExclamationConfirm
        open={show}
        title="服务通知"
        // description="尊敬的用户，根据我们的使用条款和当地法规，当前功能在您所属的地区不可用。"
        onClose={onClose}
        onCancel={onClose}
        onOk={() => {
          alert("确认")
          onClose()
        }}
      />
    </div>
  )
}

export const Normal = Template.bind({})
