import type { Meta, StoryObj } from '@storybook/nextjs-vite'
import { fn } from 'storybook/test'
import { BookingCodeChip } from './index'

const meta = {
  title: 'Product Components/BookingCodeChip',
  component: BookingCodeChip,
  parameters: {
    layout: 'centered',
  },
} satisfies Meta<typeof BookingCodeChip>

export default meta
type Story = StoryObj<typeof BookingCodeChip>

export const Default: Story = {
  args: {},
  render: () => <BookingCodeChip bookingCode="ABC123" withText />,
}

export const WithoutText: Story = {
  args: {},
  render: () => <BookingCodeChip bookingCode="ABC123" withText={false} />,
}

export const Unavailable: Story = {
  args: {},
  render: () => <BookingCodeChip bookingCode="ABC123" isUnavailable />,
}

export const AlignCenter: Story = {
  args: {},
  render: () => <BookingCodeChip bookingCode="ABC123" alignCenter />,
}

export const WithCloseButton: Story = {
  args: {},
  render: () => (
    <BookingCodeChip bookingCode="ABC123" withCloseButton onClose={fn} />
  ),
}

export const CampaignWithoutBookingCode: Story = {
  args: {},
  render: () => <BookingCodeChip isCampaign />,
}

export const CampaignWithBookingCode: Story = {
  args: {},
  render: () => <BookingCodeChip isCampaign bookingCode="SUMMER25" />,
}
