import type { Meta, StoryObj } from '@storybook/react'

import { RateCard } from './RateCard'

const meta: Meta<typeof RateCard> = {
  title: 'Components/RateCard/Code',
  component: RateCard,
  decorators: [
    (Story) => (
      <div style={{ maxWidth: '400px' }}>
        <Story />
      </div>
    ),
  ],
  argTypes: {
    title: { control: 'text' },
  },
}

export default meta

type Story = StoryObj<typeof RateCard>

export const Default: Story = {
  args: {
    variant: 'Code',
    title: 'FREE CANCELLATION / PAY LATER',
    bannerText: 'Campaign ∙ Breakfast excluded',
    rate: {
      label: "Valentine's Special",
      price: '1989',
      unit: 'EUR/night',
    },
    approximateRate: {
      price: '1989 EUR',
      label: 'Approx.',
    },
  },
}

export const Voucher: Story = {
  args: {
    variant: 'Code',
    title: 'FREE CANCELLATION / PAY LATER',
    bannerText: 'VOG ∙ Breakfast included',
    rate: {
      label: 'Promotional name here',
      price: '1',
      unit: 'VOUCHER',
    },
  },
}

export const CorporateCheck: Story = {
  args: {
    variant: 'Code',
    title: 'FREE CANCELLATION / PAY LATER',
    bannerText: 'VOG ∙ Breakfast included',
    rate: {
      label: 'Promotional name here',
      price: '2cc + 800',
      unit: 'SEK',
    },
    approximateRate: {
      price: '76 EUR',
      label: 'Approx.',
    },
  },
}

export const DNumberDefault: Story = {
  args: {
    variant: 'Code',
    title: 'FREE CANCELLATION / PAY LATER',
    bannerText: 'D0043148 ∙ Breakfast included',
    rate: {
      label: 'Helsinki Partners Oy',
      price: '1989',
      unit: 'EUR/NIGHT',
    },
    approximateRate: {
      price: '76 EUR',
      label: 'Approx.',
    },
  },
}

export const DNumberHighlightedRate: Story = {
  args: {
    variant: 'Code',
    title: 'FREE CANCELLATION / PAY LATER',
    bannerText: 'D0043148 ∙ Breakfast included',
    rate: {
      label: 'Helsinki Partners Oy',
      price: '198',
      unit: 'EUR/NIGHT',
    },
    approximateRate: {
      price: '76 EUR',
      label: 'Approx.',
    },
    isHighlightedRate: true,
  },
}

export const LNumberDefault: Story = {
  args: {
    variant: 'Code',
    title: 'NON-REFUNDABLE / PAY NOW',
    bannerText: 'L0043148 ∙ Breakfast included',
    rate: {
      label: 'Nordic Team Travel',
      price: '198',
      unit: 'EUR/NIGHT',
    },
    approximateRate: {
      price: '76 EUR',
      label: 'Approx.',
    },
  },
}

export const LNumberStrikethrough: Story = {
  args: {
    variant: 'Code',
    title: 'NON-REFUNDABLE / PAY NOW',
    bannerText: 'L0043148 ∙ Breakfast included',
    rate: {
      label: 'Nordic Team Travel',
      price: '198',
      unit: 'EUR/NIGHT',
    },
    comparisonRate: {
      price: '249',
      unit: 'EUR/NIGHT',
    },
    approximateRate: {
      price: '230/218 EUR',
      label: 'Approx.',
    },
  },
}
