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

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

export default meta
type Story = StoryObj<typeof meta>

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

export const WithCustomContent: Story = {
  args: { src: "https://www.openstreetmap.org", title: "OpenStreetMap" },
}

export const Showcase: Story = {
  args: {} as never,
  render: () => ({
    components: { IframeDisplay },
    template: `
      <div class="flex flex-col gap-6">
        <IframeDisplay src="https://example.com" title="Example" />
      </div>
    `,
  }),
}
