import { ComponentMeta, ComponentStory } from "@storybook/react";
import { FileUpload } from "./";
import "./story.css";

// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
  title: "Example/FileUpload",
  component: FileUpload,
} as ComponentMeta<typeof FileUpload>;

// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
const Template: ComponentStory<typeof FileUpload> = (args) => (
  <form
    onSubmit={(e) => {
      e.preventDefault();
      console.log("Form submitted");
    }}
  >
    <FileUpload className="story" {...args} />
    <button type="submit">Submit</button>
  </form>
);

export const Primary = Template.bind({});
// More on args: https://storybook.js.org/docs/react/writing-stories/args
Primary.args = {
  children: "Upload",
  required: true,
};

export const Secondary = Template.bind({});
Secondary.args = {
  children: "Upload",
  required: false,
};
