import { Meta, StoryObj } from "@storybook/react";
import { InternalLink } from "./index"; // Assuming RouteContext is exported

const meta: Meta<typeof InternalLink> = {
  title: "Example/InternalLink",
  component: InternalLink,
  parameters: {
    layout: "centered",
  },
  tags: ["autodocs"],
  argTypes: {
    to: {
      control: "object",
      description: "RouteRecord object { id, path, params? }",
    },
    query: {
      control: "object",
      description: "Array of { key, value } objects for query parameters",
    },
    prefetch: {
      control: "select",
      options: ["intent", "render", "none"],
    },
    newTab: {
      control: "boolean",
    },
    preserveSearchParams: {
      control: "boolean",
    },
    variant: {
      control: "select",
      options: ["solid", "subtle", "outline", "elevated", "line", "none"],
    },
    className: { control: "text" },
    children: { control: "text" },
  },
};

export default meta;

type Story = StoryObj<typeof InternalLink>;

export const Default: Story = {
  args: {
    to: { id: "about", path: "about" },
    children: "Link to About",
    prefetch: "render",
  },
};
