"use client" import { useIntl } from "react-intl" import { Typography } from "@scandic-hotels/design-system/Typography" import { formatPrice } from "@/utils/numberFormatting" import { getPeriod } from "./utils" import styles from "./parkingPrices.module.css" import { type ParkingPricesProps, Periods, } from "@/types/components/hotelPage/sidepeek/parking" export default function ParkingPrices({ currency = "", freeParking, pricing, }: ParkingPricesProps) { const intl = useIntl() return freeParking ? (

{intl.formatMessage({ defaultMessage: "Free parking" })}

) : (
{pricing?.map((parking) => (
{getPeriod(intl, parking.period)}
{parking.amount ? formatPrice(intl, parking.amount, currency) : intl.formatMessage({ defaultMessage: "At a cost", })}
{parking.startTime && parking.endTime && parking.period !== Periods.allDay && (
{intl.formatMessage({ defaultMessage: "From" })}
{/* eslint-disable formatjs/no-literal-string-in-jsx */}
{`${parking.startTime}-${parking.endTime}`}
)}
))}
) }