import type { Meta, StoryObj } from "@storybook/react"
import { BugReport } from "./bug-report"

const meta: Meta<typeof BugReport> = {
  title: "Widgets/Support/BugReport",
  component: BugReport,
  parameters: {
    layout: "centered",
  },
  tags: ["autodocs"],
  argTypes: {
    variant: {
      control: "radio",
      options: ["popover", "modal"],
    },
    side: {
      control: "radio",
      options: ["top", "bottom", "left", "right"],
    },
    showStepsToReproduce: { control: "boolean" },
    showWorkedBefore: { control: "boolean" },
  },
}

export default meta
type Story = StoryObj<typeof BugReport>

export const Default: Story = {
  args: {
    onSubmit: async (data) => {
      console.log("Bug report submitted:", data)
      await new Promise((resolve) => setTimeout(resolve, 500))
    },
  },
}

export const Popover: Story = {
  args: {
    variant: "popover",
    onSubmit: async (data) => {
      console.log("Bug report submitted:", data)
      await new Promise((resolve) => setTimeout(resolve, 500))
    },
  },
}
