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)
40 lines
1.0 KiB
TypeScript
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>
|
|
)
|
|
}
|