Files
web/apps/scandic-web/components/Blocks/DynamicContent/Points/ExpiringPoints/index.tsx
Erik Tiekstra 339e7195dc fix(BOOK-436): Added new section component and deprecated the other
Approved-by: Chuma Mcphoy (We Ahead)
2025-10-13 08:31:26 +00:00

31 lines
855 B
TypeScript

import { getMembershipLevel } from "@/lib/trpc/memoizedRequests"
import { Section } from "@/components/Section"
import SectionHeader from "@/components/Section/Header/Deprecated"
import ExpiringPointsTable from "./ExpiringPointsTable"
import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage"
export default async function ExpiringPoints({
link,
subtitle,
title,
}: AccountPageComponentProps) {
const membershipLevel = await getMembershipLevel()
if (!membershipLevel?.pointsToExpire || !membershipLevel?.pointsExpiryDate) {
return null
}
return (
<Section>
<SectionHeader title={title} link={link} preamble={subtitle} />
<ExpiringPointsTable
points={membershipLevel.pointsToExpire}
expirationDate={membershipLevel.pointsExpiryDate}
/>
</Section>
)
}