import * as React from "react";
import type { ComponentStory, ComponentMeta } from "@storybook/react";
import { TransferFundsModal } from "../src";
import { useCallback } from "react"

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

const Template: ComponentStory<typeof TransferFundsModal> = args => {
  const [show, setShow] = React.useState(true);
  const onClose = useCallback(() => setShow(false), []);
  
  return <>
    <TransferFundsModal
      {...args}
      open={show}
      onClose={onClose}
      onConfirm={o => {
        onClose();
        console.log(o);
      }}
    />
    <button onClick={() => setShow(true)}>show modal</button>
  </>
}

export const Normal = Template.bind({});
