Files
web/apps/scandic-web/components/MyPages/Surprises/Initial.tsx
Joakim Jäderberg aafad9781f Merged in feat/lokalise-rebuild (pull request #2993)
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
2025-10-22 11:00:03 +00:00

79 lines
2.2 KiB
TypeScript

import { useIntl } from "react-intl"
import { Button } from "@scandic-hotels/design-system/Button"
import { Typography } from "@scandic-hotels/design-system/Typography"
import Card from "./Card"
import styles from "./surprises.module.css"
import type { InitialProps } from "@/types/components/blocks/surprises"
export default function Initial({ totalSurprises, onOpen }: InitialProps) {
const intl = useIntl()
return (
<Card
title={intl.formatMessage({
id: "rewards.surprise",
defaultMessage: "Surprise!",
})}
>
<Typography variant="Body/Paragraph/mdRegular">
<p className={styles.textCenter}>
{totalSurprises > 1 ? (
<>
{intl.formatMessage(
{
id: "myPages.surprises.giftsWaiting",
defaultMessage:
"You have <b>{amount}</b> gifts waiting for you!",
},
{
amount: totalSurprises,
b: (str) => <b>{str}</b>,
}
)}
<br />
{intl.formatMessage({
id: "myPages.surprises.willExpire",
defaultMessage: "Hurry up and use them before they expire!",
})}
</>
) : (
intl.formatMessage({
id: "myPages.surprises.giftWaiting",
defaultMessage: "We have a special gift waiting for you!",
})
)}
</p>
</Typography>
<Typography variant="Body/Supporting text (caption)/smRegular">
<p>
{intl.formatMessage({
id: "myPages.surprises.findGifts",
defaultMessage: "You'll find all your gifts in 'My benefits'",
})}
</p>
</Typography>
<Button
variant="Primary"
onPress={onOpen}
size="Medium"
autoFocus
typography="Body/Paragraph/mdBold"
className={styles.widthFull}
>
{intl.formatMessage(
{
id: "myPages.surprises.openGifts",
defaultMessage: "Open {amount, plural, one {gift} other {gifts}}",
},
{ amount: totalSurprises }
)}
</Button>
</Card>
)
}