import type { RadioItem } from "@/pages/learningPath/learningContentPage/feedback/feedback.types";
import type { Meta, StoryObj } from "@storybook/vue3";
import ItRadioGroup from "./ItRadioGroup.vue";

const meta: Meta<typeof ItRadioGroup> = {
  title: "VBV/RadioGroup",
  component: ItRadioGroup,
  argTypes: { "onUpdate:modelValue": { action: "updated" } },
};

export default meta;
type Story = StoryObj<typeof ItRadioGroup>;
let modelValue = "a";

const items: RadioItem<string>[] = [
  {
    value: "a",
    name: "A",
  },
  {
    value: "b",
    name: "B",
  },
];

export const RadioGroup: Story = {
  args: {
    modelValue: modelValue,
    items: items,
    label: "Radiogroup",
    "onUpdate:modelValue": (newValue: any) => {
      modelValue = newValue;
    },
  },
};
