Files
web/apps/scandic-web/components/Blocks/DynamicContent/Rewards/CurrentRewards/index.tsx
Linus Flood f8577dd09a Merged in fix/env-cleanup (pull request #3132)
fix(env): remove SHOW_SITEWIDE_ALERT and USE_NEW_REWARD_MODEL

* fix(env): remove SHOW_SITEWIDE_ALERT and USE_NEW_REWARD_MODEL


Approved-by: Matilda Landström
Approved-by: Chuma Mcphoy (We Ahead)
2025-11-12 09:04:59 +00:00

40 lines
1.0 KiB
TypeScript

import {
getCurrentRewards,
getMembershipLevel,
} from "@/lib/trpc/memoizedRequests"
import { Section } from "@/components/Section"
import SectionHeader from "@/components/Section/Header/Deprecated"
import SectionLink from "@/components/Section/Link"
import ClientCurrentRewards from "./Client"
import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage"
export default async function CurrentRewardsBlock({
title,
subtitle,
link,
}: AccountPageComponentProps) {
const [rewardsResponse, membershipLevel] = await Promise.all([
getCurrentRewards(),
getMembershipLevel(),
])
if (!rewardsResponse?.rewards.length) {
return null
}
return (
<Section>
<SectionHeader title={title} link={link} preamble={subtitle} />
<ClientCurrentRewards
rewards={rewardsResponse.rewards}
showRedeem={true}
membershipNumber={membershipLevel?.membershipNumber}
/>
<SectionLink link={link} variant="mobile" />
</Section>
)
}