import OrderHeader from "../../../view/order_id/[id]/_components/OrderHeader";
import AccountSwiper from "@components/customer/accountSwiper";
import TrackDetail from "./_components/TrackDetail"
type Params = {
  id: string;
};

export default async function TrackOrderDetail({ params }: { params: Params }) {
  // 拿到动态订单ID：211600
  const orderId = params.id;

  // === 服务端请求订单接口，传入订单号 ===
//   const res = await fetch(
//     `${process.env.API_URL}/api/order/detail?id=${orderId}`,
//     {
//       next: { revalidate: 0 },
//     },
//   );
  //   const orderData = await res.json();
  console.log("orderId:",orderId);
  // const orderData = {
  //   shipTo: "Zhang Zhenfei,\nAaaaaaaa, Zzzzzz, Alaska\n90602, United States",
  //   orderNo: orderId, // 自动使用路由传入的订单号
  //   status: "Processing",
  //   orderDate: "March 6, 2026",
  //   shippingMethod: "USPS/FedEx(2-7 Business Days)",
  //   paymentMethod: "Klarna",
  //   CustomerEmail:"18567768109@163.Com",
  //   paymentDetail: {
  //     Customer: "18567768109",
  //     Email: "@163.Com",
  //     "Payment Method": "PayoneerKlarna",
  //     "Payment Status": "Processing",
  //     "Order No": "100055676",
  //     "Customer Firstname": "Zhang",
  //     "Customer Lastname": "Zhenfei",
  //   },
  //   // 多商品数组，自动兼容1件/多件商品
  //   items: [
  //     {
  //       name: "Human Hair Headband Wigs Curly Bob Wig Straight Hair Wigs",
  //       spec: "8, Straight, 5 Free Headbands.",
  //       price: "$114.11",
  //       qty: 1,
  //     },
  //     // 你可以取消注释，测试多商品渲染
  //     /*
  //     {
  //       name: "Deep Wave Lace Front Human Hair Wig",
  //       spec: "13x4 Lace, Medium Cap, 180% Density",
  //       price: "$252.00",
  //       qty: 2,
  //     },
  //     */
  //   ],
  //   price: {
  //     subtotal: "$114.11",
  //     shipping: "$0.00",
  //     insurance: "$3.42",
  //     total: "$117.53",
  //   },
  // };
  return (
    <div className="bg-gray-50 min-h-screen">
      {/* 顶部固定导航栏（客户端组件：返回按钮） */}
      <OrderHeader title="Track Order" />

      <div className="px-5 py-4">
        <TrackDetail />
      </div>
         <AccountSwiper/>
    </div>
  );
}
