feat(SW-3225): Move ParkingInformation to design-system * Inline ParkingInformation types to remove trpc dependency * Move ParkingInformation to design-system * Move numberFormatting to common package * Add deps to external * Fix imports and i18n script * Add common as dependency * Merge branch 'master' into feat/sw-3225-move-parking-information-to-booking-flow Approved-by: Linus Flood
35 lines
838 B
TypeScript
35 lines
838 B
TypeScript
"use client"
|
|
import { useIntl } from "react-intl"
|
|
|
|
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
|
|
|
import { getFeatureDescription } from "@/components/HotelReservation/utils/getRoomFeatureDescription"
|
|
|
|
import RegularRow from "../Regular"
|
|
|
|
import type { Packages as PackagesType } from "@scandic-hotels/trpc/types/packages"
|
|
|
|
interface PackagesProps {
|
|
packages: PackagesType | null
|
|
}
|
|
|
|
export default function PackagesRow({ packages }: PackagesProps) {
|
|
const intl = useIntl()
|
|
|
|
if (!packages || !packages.length) {
|
|
return null
|
|
}
|
|
|
|
return packages?.map((pkg) => (
|
|
<RegularRow
|
|
key={pkg.code}
|
|
label={getFeatureDescription(pkg.code, pkg.description, intl)}
|
|
value={formatPrice(
|
|
intl,
|
|
+pkg.localPrice.totalPrice,
|
|
pkg.localPrice.currency
|
|
)}
|
|
/>
|
|
))
|
|
}
|