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

import { challenges, shortcuts, stays } from "./_constants"

import Overview from "@/components/MyPages/Blocks/Overview"
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
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()
  const user = {
    ...data,
    journeys: challenges.journeys,
    membershipId: 30812404844732,
    nights: 14,
    points: 20720,
    qualifyingPoints: 5000,
    shortcuts,
    stays,
    victories: challenges.victories,
  }
  return (
    <main className={styles.blocks}>
      <Overview user={user} />
      <UpcomingStays lang={params.lang} stays={user.stays} />
      <Shortcuts shortcuts={user.shortcuts} />
    </main>
  )
}
