import React from "react";
import { Meta, Story } from "@storybook/react";
import { AtomButtonDefault } from "react/atoms/Buttons/Default";
import { action } from "@storybook/addon-actions";
import { IProps } from "react/atoms/Buttons/ButtonProps";

const meta: Meta = {
  title: "React/atoms/Button",
  component: AtomButtonDefault,
  argTypes: {
    onClick: {
      table: {
        disable: true,
      },
    },
  },
  parameters: {
    controls: { expanded: true },
  },
};

export default meta;

const TemplateDefault: Story<IProps> = (props) => (
  <AtomButtonDefault {...props} />
);

// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
// https://storybook.js.org/docs/react/workflows/unit-testing
export const Default = TemplateDefault.bind({});

Default.args = {
  disabled: false,
  onClick: action("Event Click"),
  color: "primary",
  text: "Text",
  type: "button",
  width: "144px",
  customColor: "tertiary",
};
