import type { Meta, StoryObj } from "@storybook/vue3-vite"
import QrCodeDisplay from "./QrCodeDisplay.vue"
import { componentDoc } from "@/lib/storybook"

const meta = {
  title: "Elements/Display/QrCodeDisplay",
  component: QrCodeDisplay,
  tags: ["autodocs"],
  args: { value: "https://example.com" },
  parameters: componentDoc("QrCodeDisplay", { barrel: "display" }),
  decorators: [
    () => ({
      template: '<div class="p-4"><story /></div>',
    }),
  ],
} satisfies Meta<typeof QrCodeDisplay>

export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {
  args: { value: "https://example.com" },
}

export const WithCustomContent: Story = {
  args: { value: "GXP-EVENT-2026" },
}

export const Showcase: Story = {
  args: {} as never,
  render: () => ({
    components: { QrCodeDisplay },
    template: `
      <div class="flex gap-6">
        <QrCodeDisplay value="https://example.com" />
        <QrCodeDisplay value="Some text content" />
      </div>
    `,
  }),
}
