import type { Meta, StoryObj } from "@storybook/react";
import { CookieConsentBannerLoader } from "./cookie-consent-banner-loader";

const meta = {
  title: "Organisms/CookieConsentBannerLoader",
  component: CookieConsentBannerLoader,
  tags: ["autodocs"],
  parameters: {
    layout: "fullscreen",
    docs: {
      description: {
        component:
          "SSR-safe wrapper around `<CookieConsentBanner>`. Renders null on the server and mounts the banner after hydration. Use this in Next.js Server Components or any SSR context.",
      },
    },
  },
} satisfies Meta<typeof CookieConsentBannerLoader>;

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

export const Modal: Story = {
  args: {
    variant: "modal",
    onConsentChange: (states) => console.log("Consent changed", states),
  },
};

export const Banner: Story = {
  args: {
    variant: "banner",
    onConsentChange: (states) => console.log("Consent changed", states),
  },
};
