import type { Meta, StoryObj } from "@storybook/svelte";
import Selector from "../components/utils/Selector.svelte";
import RouterDecorator from "./RouterDecorator.svelte";

const meta: Meta<Selector> = {
  title: "Widgets/Selector",
  component: Selector,
  tags: ["autodocs"],
  argTypes: {
    onInput: {
      action: "input",
    },
    onFocus: {
      action: "focus",
    },
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
  } as any,
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  decorators: [() => RouterDecorator as any], // due to upobject link in selected state
};

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

export const Attribute: Story = {
  args: {
    type: "attribute",
  },
};

export const AllValues: Story = {
  args: {
    type: "value",
  },
};

export const Entities: Story = {
  args: {
    type: "value",
    valueTypes: ["Address"],
  },
};

export const Strings: Story = {
  args: {
    type: "value",
    valueTypes: ["String"],
  },
};

export const Numbers: Story = {
  args: {
    type: "value",
    valueTypes: ["Number"],
  },
};
