Chore/BOOK-708 replace title component * chore(BOOK-708): replace title with typography * chore(BOOK-708): replace title with typography * chore(BOOK-708): remove Title from package.json Approved-by: Linus Flood Approved-by: Anton Gunnarsson
31 lines
850 B
TypeScript
31 lines
850 B
TypeScript
import { getMembershipLevel } from "@/lib/trpc/memoizedRequests"
|
|
|
|
import { Section } from "@/components/Section"
|
|
import { SectionHeader } from "@/components/Section/Header"
|
|
|
|
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 heading={title} link={link} preamble={subtitle} />
|
|
<ExpiringPointsTable
|
|
points={membershipLevel.pointsToExpire}
|
|
expirationDate={membershipLevel.pointsExpiryDate}
|
|
/>
|
|
</Section>
|
|
)
|
|
}
|