Feat(WEB-307) Display correct membership information * fix: fix typo * chore: update fetch of user membership * chore: update components to use api data * chore: remove lang as static value * fix: adapt to dev updates * fix: adapt to code from dev * fix: break out MembershipLevel into its a React component * fix: add enum to zod validation * refactor: rename tier to level * refactor: remove unnecessary casts * refactor: change toString() to hideEmpty=false * refactor: remove toString() * refactor: remove hideEmpty from title and subtitle * fix: update currentLevel with data * fix: fix from rebase Approved-by: Michael Zetterberg
35 lines
940 B
TypeScript
35 lines
940 B
TypeScript
import { serverClient } from "@/lib/trpc/server"
|
|
|
|
import Header from "@/components/SectionHeader"
|
|
import Divider from "@/components/TempDesignSystem/Divider"
|
|
|
|
import Friend from "./Friend"
|
|
import Stats from "./Stats"
|
|
|
|
import styles from "./overview.module.css"
|
|
|
|
import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage"
|
|
import type { LangParams } from "@/types/params"
|
|
|
|
export default async function Overview({
|
|
link,
|
|
subtitle,
|
|
title,
|
|
lang,
|
|
}: AccountPageComponentProps & LangParams) {
|
|
const user = await serverClient().user.get()
|
|
if (!user) {
|
|
return null
|
|
}
|
|
return (
|
|
<section className={styles.container}>
|
|
<Header link={link} subtitle={subtitle} title={title} topTitle />
|
|
<section className={styles.overview}>
|
|
<Friend user={user} />
|
|
<Divider className={styles.divider} />
|
|
<Stats user={user} lang={lang} />
|
|
</section>
|
|
</section>
|
|
)
|
|
}
|