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

export default {
  title: "确认弹窗/ServiceNoticeConfirm",
  component: ServiceNoticeConfirm
} as ComponentMeta<typeof ServiceNoticeConfirm>

// Story模版
const Template: ComponentStory<typeof ServiceNoticeConfirm> = () => {
  const [show, setShow] = React.useState(false)

  const onClose = () => setShow(false)

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

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

export const Normal = Template.bind({})
