feat(SW-3526): Show EB points rate and label in booking flow * feat(SW-3526): Show EB points rate and label in booking flow * feat(SW-3526) Optimized points currency code * feat(SW-3526) Removed extra multiplication for token expiry after rebase * feat(SW-3526): Updated to exhaustive check and thow if type error Approved-by: Anton Gunnarsson
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import { useIntl } from 'react-intl'
|
|
|
|
import Caption from '../../Caption'
|
|
import Subtitle from '../../Subtitle'
|
|
|
|
import styles from './hotelPointsRow.module.css'
|
|
import { CurrencyEnum } from '@scandic-hotels/common/constants/currency'
|
|
|
|
export type PointsRowProps = {
|
|
pointsPerStay: number
|
|
additionalPricePerStay?: number
|
|
additionalPriceCurrency?: string
|
|
pointsCurrency?: CurrencyEnum
|
|
}
|
|
export function HotelPointsRow({
|
|
pointsPerStay,
|
|
additionalPricePerStay,
|
|
additionalPriceCurrency,
|
|
pointsCurrency,
|
|
}: PointsRowProps) {
|
|
const intl = useIntl()
|
|
|
|
return (
|
|
<div className={styles.poinstRow}>
|
|
<Subtitle type="two" color="uiTextHighContrast">
|
|
{pointsPerStay}
|
|
</Subtitle>
|
|
<Caption color="uiTextHighContrast">
|
|
{pointsCurrency ??
|
|
intl.formatMessage({
|
|
defaultMessage: 'Points',
|
|
})}
|
|
</Caption>
|
|
{additionalPricePerStay ? (
|
|
<>
|
|
{'+'}
|
|
<Subtitle type="two" color="uiTextHighContrast">
|
|
{additionalPricePerStay}
|
|
</Subtitle>
|
|
<Caption color="uiTextHighContrast">
|
|
{additionalPriceCurrency}
|
|
</Caption>
|
|
</>
|
|
) : null}
|
|
</div>
|
|
)
|
|
}
|