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

import MyPagesSidebar from "@/components/MyPages/Sidebar"

import { LangParams } from "@/types/params"

export default async function MyPagesNavigation({ lang }: LangParams) {
  const user = await serverClient().user.name()

  // Check if we have user, that means we are logged in.
  if (!user) {
    return null
  }

  return <MyPagesSidebar lang={lang} />
}
