import type { Meta, StoryObj } from "@storybook/react";
import { Trust, type TrustProps } from "..";
import { excludeControls } from "../../utils";
import { TrustpilotProvider } from "./TrustpilotProvider";

type StoryType = StoryObj<typeof Trust>;

const meta: Meta<typeof Trust> = {
  title: "Components/Trust",
  component: Trust,
  argTypes: excludeControls(
    "className",
    "locale",
    "variant",
    "theme",
    "width",
    "height",
    "templateId",
    "stars",
  ),
  decorators: [
    Story => (
      <TrustpilotProvider>
        <Story />
      </TrustpilotProvider>
    ),
  ],
};

export const MicroCombo: StoryType = {
  render: (args: TrustProps) => <Trust {...args} />,
  args: {
    locale: "en-US",
    variant: "micro-combo",
    theme: "light",
  },
};

export const Mini: StoryType = {
  render: (args: TrustProps) => <Trust {...args} />,
  args: {
    locale: "en-US",
    variant: "mini",
    theme: "light",
  },
};

export const Horizontal: StoryType = {
  render: (args: TrustProps) => <Trust {...args} />,
  args: {
    locale: "en-US",
    variant: "horizontal",
    theme: "light",
  },
};

export const Carousel: StoryType = {
  render: (args: TrustProps) => <Trust {...args} />,
  args: {
    locale: "en-US",
    variant: "carousel",
    theme: "light",
    stars: "4,5",
  },
};

export const MicroStar: StoryType = {
  render: (args: TrustProps) => <Trust {...args} />,
  args: {
    locale: "en-US",
    variant: "micro-star",
    theme: "light",
    stars: "4,5",
  },
};

export default meta;
