import type { Meta, StoryObj } from "@storybook/react"
import { Feedback } from "./feedback"

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

export default meta
type Story = StoryObj<typeof Feedback>

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

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