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"

export default async function Overview({
  link,
  subtitle,
  title,
}: AccountPageComponentProps) {
  const user = await serverClient().user.get()
  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} />
      </section>
    </section>
  )
}
