import { commonProps } from "../../utils/storybook";
import { labelDefaultVariants, labelVariantsStyles, sizeVariantsStyles } from "./label.styled";
import { Label } from ".";
import type { StoryObj, Meta } from "@storybook/react";

const labelVariants = Object.keys(labelVariantsStyles);
const sizeVariants = Object.keys(sizeVariantsStyles);

const meta: Meta<typeof Label> = {
  title: "Label",
  component: Label,
  tags: ["autodocs"],
  argTypes: {
    variant: {
      description: "Sets the variant of the label.",
      options: labelVariants,
      table: {
        type: { summary: labelVariants.join(" | ") },
        defaultValue: { summary: labelDefaultVariants.variant },
      },
    },
    size: {
      description: "Sets the size of the label.",
      options: sizeVariants,
      table: {
        type: { summary: sizeVariants.join(" | ") },
        defaultValue: { summary: labelDefaultVariants.size },
      },
    },
    ...commonProps,
  },
  args: {
    children: "I am a label",
    variant: labelDefaultVariants.variant,
    size: labelDefaultVariants.size,
  },
};
export default meta;

type Story = StoryObj<typeof Label>;

export const Default: Story = {
  render: (args) => <Label {...args} />,
};
