"use client"

import { BookingCodeChip } from "@scandic-hotels/design-system/BookingCodeChip"

import styles from "./row.module.css"

interface BookingCodeRowProps {
  bookingCode?: string
  isBreakfastIncluded?: boolean
  isCampaignRate?: boolean
}

export default function BookingCodeRow({
  bookingCode,
  isCampaignRate,
}: BookingCodeRowProps) {
  if (!bookingCode && !isCampaignRate) {
    return null
  }

  return (
    <tr className={styles.row}>
      <td colSpan={2} align="center" className={styles.bookingCodeCell}>
        <BookingCodeChip
          alignCenter
          bookingCode={bookingCode}
          isCampaign={isCampaignRate}
        />
      </td>
    </tr>
  )
}
