"use client";

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

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

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

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