import { notFound } from "next/navigation"
import { Suspense } from "react"

import { MyStaySkeleton } from "@/components/HotelReservation/MyStay/myStaySkeleton"
import { Receipt } from "@/components/HotelReservation/MyStay/Receipt"

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

export default async function ReceiptPage(
  props: PageArgs<LangParams, { RefId?: string }>
) {
  const searchParams = await props.searchParams
  if (!searchParams.RefId) {
    notFound()
  }
  return (
    <Suspense fallback={<MyStaySkeleton />}>
      <Receipt refId={searchParams.RefId} />
    </Suspense>
  )
}
