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

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

export default async function ReceiptPage(
  props: PageProps<"/[lang]/hotelreservation/my-stay/receipt">
) {
  const searchParams = await props.searchParams
  if (!searchParams.RefId || typeof searchParams.RefId !== "string") {
    notFound()
  }

  return (
    <Suspense fallback={<MyStaySkeleton />}>
      <Receipt refId={searchParams.RefId} />
    </Suspense>
  )
}
