import { serverClient } from "@/lib/trpc/server"

import Overview from "@/components/MyPages/Blocks/Overview"
import OverviewMobile from "@/components/MyPages/Blocks/Overview/Mobile"
import Title from "@/components/MyPages/Title"
import UpcomingStays from "@/components/MyPages/Blocks/UpcomingStays"

import styles from "./page.module.css"

import type { LangParams, PageArgs } from "@/types/params"

export default async function MyPage({ params }: PageArgs<LangParams>) {
  const data = await serverClient().user.get()
  return (
    <section className={styles.container}>
      <header className={styles.header}>
        <Title uppercase>Good morning {data.name}</Title>
      </header>
      <section className={styles.blocks}>
        <Overview />
        <OverviewMobile />
        <UpcomingStays lang={params.lang} />
      </section>
    </section>
  )
}
