import type { Meta, StoryObj } from '@storybook/react-vite'
import { expect } from 'storybook/test'

import { Badge } from './badge'

const meta = {
  component: Badge,
  tags: ['ai-generated'],
} satisfies Meta<typeof Badge>

export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {
  args: { children: 'Public' },
  play: async ({ canvas }) => {
    const badge = canvas.getByText('Public')
    await expect(badge).toHaveAttribute('data-slot', 'badge')
  },
}

export const Secondary: Story = {
  args: { variant: 'secondary', children: 'Internal' },
}

export const Destructive: Story = {
  args: { variant: 'destructive', children: 'Error' },
}

export const Success: Story = {
  args: { variant: 'success', children: 'Public' },
}

export const Warning: Story = {
  args: { variant: 'warning', children: 'Internal' },
}

export const Outline: Story = {
  args: { variant: 'outline', children: 'Draft' },
}
