fix(SW-2425): filter description should be translated with lokalise * fix(SW-2425): filter description should be translated with lokalise Approved-by: Anton Gunnarsson
34 lines
816 B
TypeScript
34 lines
816 B
TypeScript
"use client"
|
|
import { useIntl } from "react-intl"
|
|
|
|
import { getFeatureDescription } from "@/components/HotelReservation/utils/getRoomFeatureDescription"
|
|
import { formatPrice } from "@/utils/numberFormatting"
|
|
|
|
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
|
|
)}
|
|
/>
|
|
))
|
|
}
|