import type { Meta, StoryObj } from "@storybook/react"
import { Resolution } from "./resolution"

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

export default meta
type Story = StoryObj<typeof Resolution>

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

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