import { Meta, StoryObj } from "@storybook/nextjs-vite";
import { ActionButton } from "./ActionButton";
import Link from "next/link";
import { fn } from "storybook/test";

/** Reusable ActionButton Component */
const meta: Meta<typeof ActionButton> = {
  title: "UI/ActionButton",
  component: ActionButton,
  tags: ["autodocs"],
  args: {
    disabled: false,
    asChild: false,
    cornerRadius: "3xl",
    children: "Continue",
    onClick: fn(),
  },
  argTypes: {
    cornerRadius: {
      control: { type: "select" },
      options: ["3xl", "full"],
    },
    asChild: {
      control: { type: "boolean" },
    },
  },
};

export default meta;
type Story = StoryObj<typeof meta>;

export const Default = {} satisfies Story;

export const Disabled = {
  args: {
    children: "Disabled",
    disabled: true,
  },
} satisfies Story;

export const AsChild = {
  args: {
    asChild: true,
    children: <Link href="#test">Link ActionButton</Link>,
  },
} satisfies Story;

export const CornerRadiusFull = {
  args: {
    cornerRadius: "full",
    children: "Full Corner Radius",
  },
} satisfies Story;

export const CornerRadius3xl = {
  args: {
    cornerRadius: "3xl",
    children: "3xl Corner Radius",
  },
} satisfies Story;
