"use client";

import { useSearchParams } from "next/navigation";
import { Suspense } from "react";
import { usePopCompanyPath } from "@/hooks/usePopCompanyPath";
import { InboundCartPage } from "../../_components/inbound/InboundCartPage";

function InboundCartContent() {
  const searchParams = useSearchParams();
  const companyPath = usePopCompanyPath();
  const backUrl = searchParams.get("backUrl") || companyPath("/pop/inbound");

  return <InboundCartPage backUrl={backUrl} />;
}

export default function InboundCartRoute() {
  return (
    <Suspense
      fallback={
        <div className="flex items-center justify-center py-12 text-sm text-gray-400">
          불러오는 중...
        </div>
      }
    >
      <InboundCartContent />
    </Suspense>
  );
}
