import{j as e,H as r}from"./app-BRoRPa4x.js";import{A as i}from"./AdminLayout-DCcA2Aje.js";import"./Dropdown-B4bpLCgK.js";import"./transition-u43f5Dc-.js";import"./proxy-iYr3ghlA.js";import"./sweetalert2.esm.all-UgF8mXO5.js";import"./ChevronRightIcon-BDYMGWwz.js";function o({auth:a,order:t}){return e.jsxs(i,{user:a.user,header:e.jsx("h2",{className:"font-semibold text-xl text-gray-800 leading-tight",children:"Order Details"}),children:[e.jsx(r,{title:"Order Details"}),e.jsx("div",{className:"py-12",children:e.jsx("div",{className:"max-w-7xl mx-auto sm:px-6 lg:px-8",children:e.jsx("div",{className:"bg-white overflow-hidden shadow-sm sm:rounded-lg",children:e.jsxs("div",{className:"p-6 text-gray-900",children:[e.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:["Order #",t.id]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-gray-600",children:[e.jsx("strong",{children:"Customer:"})," ",t.user?t.user.name:"N/A"]}),e.jsxs("p",{className:"text-sm text-gray-600",children:[e.jsx("strong",{children:"Total Amount:"})," $",t.total_amount]}),e.jsxs("p",{className:"text-sm text-gray-600",children:[e.jsx("strong",{children:"Status:"})," ",t.status]}),e.jsxs("p",{className:"text-sm text-gray-600",children:[e.jsx("strong",{children:"Order Date:"})," ",new Date(t.order_date).toLocaleDateString()]})]})}),e.jsx("h4",{className:"text-md font-medium text-gray-900 mb-3",children:"Order Items"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Item Type"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Item Name"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Quantity"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Price"})]})}),e.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:t.order_items.map(s=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:s.item_type}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:s.item?s.item.name||s.item.title:"N/A"}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:s.quantity}),e.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:["$",s.price]})]},s.id))})]})})]})})})})]})}export{o as default};
