Files
web/apps/scandic-web/components/Blocks/DynamicContent/Points/Overview/index.tsx
Christian Andolf 9551a629fa refactor: move divider to design system
remove not used variants and duplicate colors
2025-06-13 11:27:50 +02:00

48 lines
1.4 KiB
TypeScript

import { Divider } from "@scandic-hotels/design-system/Divider"
import { getProfile } from "@/lib/trpc/memoizedRequests"
import SectionContainer from "@/components/Section/Container"
import SectionHeader from "@/components/Section/Header"
import SectionLink from "@/components/Section/Link"
import Friend from "../../Overview/Friend"
import Hero from "../../Overview/Friend/Hero"
import MembershipNumber from "../../Overview/Friend/MembershipNumber"
import Stats from "../../Overview/Stats"
import styles from "./overview.module.css"
import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage"
export default async function PointsOverview({
link,
subtitle,
title,
}: AccountPageComponentProps) {
const user = await getProfile()
if (!user || "error" in user) {
return null
}
return (
<SectionContainer>
<SectionHeader
link={link}
preamble={subtitle}
title={title}
headingAs={"h3"}
headingLevel={"h1"}
/>
<Hero color="burgundy">
<Friend membership={user.membership} name={user.name}>
<MembershipNumber color="red" membership={user.membership} />
</Friend>
<Divider className={styles.divider} color="peach" />
<Stats user={user} />
</Hero>
<SectionLink link={link} variant="mobile" />
</SectionContainer>
)
}