import Body from "@/components/TempDesignSystem/Text/Body" import { getIntl } from "@/i18n" 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 async function ParkingPrices({ currency = "", freeParking, pricing, }: ParkingPricesProps) { const intl = await getIntl() return freeParking ? ( {intl.formatMessage({ id: "Free parking" })} ) : (
{pricing?.map((parking) => (
{getPeriod(intl, parking.period)}
{parking.amount ? formatPrice(intl, parking.amount, currency) : intl.formatMessage({ id: "At a cost" })}
{parking.startTime && parking.endTime && parking.period !== Periods.allDay && (
{intl.formatMessage({ id: "From" })}
{`${parking.startTime}-${parking.endTime}`}
)}
))}
) }