Files
web/components/Blocks/DynamicContent/OverviewTable/index.tsx
2024-12-12 11:47:44 +01:00

27 lines
784 B
TypeScript

import { getMembershipLevelSafely } from "@/lib/trpc/memoizedRequests"
import { serverClient } from "@/lib/trpc/server"
import SectionWrapper from "../SectionWrapper"
import OverviewTableClient from "./Client"
import type { OverviewTableProps } from "@/types/components/blocks/dynamicContent"
export default async function OverviewTable({
dynamic_content,
firstItem,
}: OverviewTableProps) {
const [levels, membershipLevel] = await Promise.all([
serverClient().contentstack.rewards.all(),
getMembershipLevelSafely(),
])
return (
<SectionWrapper dynamic_content={dynamic_content} firstItem={firstItem}>
<OverviewTableClient
levels={levels}
activeMembership={membershipLevel?.membershipLevel ?? null}
/>
</SectionWrapper>
)
}