Files
web/packages/design-system/lib/components/HotelCard/RoomPrice/index.tsx
Rasmus Langvad d0546926a9 Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo

* Setup prettierrc in root and remove other configs


Approved-by: Joakim Jäderberg
Approved-by: Linus Flood
2026-01-07 12:45:50 +00:00

43 lines
1021 B
TypeScript

import { useIntl } from "react-intl"
import { Typography } from "../../Typography"
interface RoomPriceProps extends React.HTMLAttributes<HTMLParagraphElement> {
price: number
currency: string
includePerNight?: boolean
}
export function RoomPrice({
price,
currency,
children,
includePerNight = true,
...props
}: RoomPriceProps) {
const intl = useIntl()
return (
<p {...props}>
<Typography variant="Title/Subtitle/md">
<span>{price}</span>
</Typography>
<Typography variant="Body/Paragraph/mdBold">
<span> {currency}</span>
</Typography>
{children}
{includePerNight ? (
<Typography variant="Body/Supporting text (caption)/smRegular">
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
<span>
/
{intl.formatMessage({
id: "common.night",
defaultMessage: "night",
})}
</span>
</Typography>
) : null}
</p>
)
}