import { Suspense } from "react"

import MyPagesSidebar from "@/components/MyPages/Sidebar"
import { isLoggedInUser } from "@/utils/isLoggedInUser"

import SidebarNavigationSkeleton from "../MyPages/Sidebar/SidebarNavigationSkeleton"

export default async function MyPagesNavigation() {
  const isLoggedIn = await isLoggedInUser()
  if (!isLoggedIn) {
    return null
  }
  return (
    <Suspense fallback={<SidebarNavigationSkeleton />}>
      <MyPagesSidebar />
    </Suspense>
  )
}
