Files
web/apps/scandic-web/components/MyPages/Profile/MembershipCards/index.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

99 lines
3.0 KiB
TypeScript

import Body from "@scandic-hotels/design-system/Body"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import Link from "@scandic-hotels/design-system/Link"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { getMembershipCards } from "@/lib/trpc/memoizedRequests"
import { getIntl } from "@/i18n"
import styles from "./membershipcards.module.css"
export default async function MembershipCardSlot() {
const intl = await getIntl()
const membershipCards = await getMembershipCards()
return (
<section className={styles.container}>
<div className={styles.content}>
<Typography variant="Title/Subtitle/md">
<h3>
{intl.formatMessage({
id: "myPages.myMembershipCards",
defaultMessage: "My membership cards",
})}
</h3>
</Typography>
</div>
{(membershipCards || []).map((card, idx) => (
<div className={styles.card} key={idx}>
<Typography variant="Title/Subtitle/md">
<h4 className={styles.subTitle}>
{intl.formatMessage(
{
id: "myPages.nameWithCardMembershipType",
defaultMessage: "Name: {cardMembershipType}",
},
{
cardMembershipType: card.membershipType,
}
)}
</h4>
</Typography>
<span>
{intl.formatMessage(
{
id: "myPages.currentPointsWithPoints",
defaultMessage: "Current Points: {points, number}",
},
{ points: card.currentPoints }
)}
</span>
<span>
{intl.formatMessage(
{
id: "myPages.memberSinceWithValue",
defaultMessage: "Member Since: {value}",
},
{
value: card.memberSince,
}
)}
</span>
<span>
{intl.formatMessage(
{
id: "myPages.numberWithValue",
defaultMessage: "Number: {membershipNumber}",
},
{
membershipNumber: card.membershipNumber,
}
)}
</span>
<span>
{intl.formatMessage(
{
id: "myPages.expirationDateWithDate",
defaultMessage: "Expiration Date: {expirationDate}",
},
{
expirationDate: card.expirationDate?.split("T")[0],
}
)}
</span>
</div>
))}
<Link href="#" variant="icon">
<MaterialIcon icon="add_circle" color="CurrentColor" />
<Body color="burgundy" textTransform="underlined">
{intl.formatMessage({
id: "myPages.addNewCard",
defaultMessage: "Add new card",
})}
</Body>
</Link>
</section>
)
}