import { Meta, StoryObj } from "@storybook/nextjs-vite";
import { Coupon } from "./Coupon";
import { fn } from "storybook/test";
import Typography from "@/components/ui/Typography/Typography";

/** Reusable Coupon Component */
const meta: Meta<typeof Coupon> = {
  title: "Widgets/Coupon",
  component: Coupon,
  tags: ["autodocs"],
  args: {
    title: {
      children: "Special Offer",
    },
    offer: {
      title: {
        children: "94% OFF",
      },
      description: {
        children: "Одноразовая эксклюзивная скидка",
      },
    },
    promoCode: {
      children: "HAIR50",
    },
    footer: {
      children: (
        <>
          Скопируйте или нажмите{" "}
          <Typography size="sm" weight="bold" className="inline text-[#9CA3AF]">
            Continue
          </Typography>
        </>
      ),
    },
    onCopyPromoCode: fn(),
  },
  argTypes: {},
};

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

export const Default = {} satisfies Story;
