feat(SW-353): dynamic rewards

This commit is contained in:
Christel Westerberg
2024-09-25 15:59:16 +02:00
parent 6a85cfd19c
commit 56cd02f90b
78 changed files with 1568 additions and 4587 deletions

View File

@@ -0,0 +1,32 @@
import { serverClient } from "@/lib/trpc/server"
import SectionContainer from "@/components/Section/Container"
import SectionHeader from "@/components/Section/Header"
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 initialCurrentRewards =
await serverClient().contentstack.rewards.current({
limit: 3,
})
if (!initialCurrentRewards) {
return null
}
return (
<SectionContainer>
<SectionHeader title={title} link={link} preamble={subtitle} />
<ClientCurrentRewards initialCurrentRewards={initialCurrentRewards} />
<SectionLink link={link} variant="mobile" />
</SectionContainer>
)
}