import { Meta, StoryObj } from "@storybook/nextjs-vite";
import { SelectAnswersList } from "./SelectAnswersList";
import { fn } from "storybook/test";

/** Reusable SelectAnswersList Component */
const meta: Meta<typeof SelectAnswersList> = {
  title: "Widgets/SelectAnswersList",
  component: SelectAnswersList,
  tags: ["autodocs"],
  args: {
    answers: [
      {
        children: "Receding hairline, want to slow its progress",
        isCheckbox: true,
        id: "hairline",
      },
      {
        children: "Experiencing hair loss, exploring",
        isCheckbox: true,
        id: "exploring",
      },
      {
        children: "Experiencing hair loss, ready to start",
        isCheckbox: true,
        id: "ready-to-start",
      },
      {
        children: "Experiencing hair loss, ready to start",
        id: "ready-to-start-text",
      },
      {
        children: "Experiencing hair loss, ready to start",
        emoji: "👩🏼",
        id: "ready-to-start-emoji",
      },
      {
        children: "Experiencing hair loss, ready to start",
        emoji: "👩🏼",
        isCheckbox: true,
        id: "ready-to-start-emoji-checkbox",
      },
    ],
    activeAnswers: [
      {
        children: "Experiencing hair loss, ready to start",
        isCheckbox: true,
        id: "ready-to-start",
      },
    ],
    onChangeSelectedAnswers: fn(),
  },
  argTypes: {},
};

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

export const Default = {} satisfies Story;
