Feat/lokalise rebuild * chore(lokalise): update translation ids * chore(lokalise): easier to switch between projects * chore(lokalise): update translation ids * . * . * . * . * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * . * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * chore(lokalise): new translations * merge * switch to errors for missing id's * merge * sync translations Approved-by: Linus Flood
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
import { useIntl } from 'react-intl'
|
|
|
|
import { RoomPrice } from '../../HotelCard/RoomPrice'
|
|
import { Typography } from '../../Typography'
|
|
|
|
import { CurrencyEnum } from '@scandic-hotels/common/constants/currency'
|
|
import styles from './hotelPointsRow.module.css'
|
|
|
|
export type PointsRowProps = {
|
|
pointsPerStay: number
|
|
additionalPricePerStay?: number
|
|
additionalPriceCurrency?: string
|
|
pointsCurrency?: CurrencyEnum
|
|
}
|
|
export function HotelPointsRow({
|
|
pointsPerStay,
|
|
additionalPricePerStay,
|
|
additionalPriceCurrency,
|
|
pointsCurrency,
|
|
}: PointsRowProps) {
|
|
const intl = useIntl()
|
|
|
|
return (
|
|
<RoomPrice
|
|
className={styles.roomPrice}
|
|
price={pointsPerStay}
|
|
currency={
|
|
pointsCurrency ??
|
|
intl.formatMessage({
|
|
id: 'common.points',
|
|
defaultMessage: 'Points',
|
|
})
|
|
}
|
|
includePerNight={false}
|
|
>
|
|
{additionalPricePerStay ? (
|
|
<>
|
|
<Typography variant="Body/Paragraph/mdBold">
|
|
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
|
<span> + </span>
|
|
</Typography>
|
|
<Typography variant="Title/Subtitle/md">
|
|
<span>{additionalPricePerStay}</span>
|
|
</Typography>
|
|
<Typography variant="Body/Paragraph/mdBold">
|
|
<span> {additionalPriceCurrency}</span>
|
|
</Typography>
|
|
</>
|
|
) : null}
|
|
</RoomPrice>
|
|
)
|
|
}
|