PageSourceSearch

https://sendunlimitedemail.com/sue/mod-D-WDcUTi.js

js sendunlimitedemail.com collected 2026-10-05 06:24:13 UTC 7,848 bytes, 1 lines download raw bytes

1import{a as P,r as i,j as e,B as d,L as p,H as _,P as C,t as h}from"./edge-BOITG1XR.js";import{C as l,a as n,b as c,c as o}from"./mod-DgQ0OFXm.js";import{o as k}from"./mod-DQMUdorF.js";import{C as r}from"./mod-BMqEiUX-.js";import{S as O}from"./mod-BsS8Yh4X.js";import{A as S}from"./mod-DeGarTfa.js";import{R as A}from"./mod-CKYw6KsV.js";import{C as g}from"./mod-B33gStZf.js";import{C as D}from"./mod-E2spV6fa.js";import{M}from"./mod-TIsvMV2X.js";import{C as b}from"./mod-C-WPWfZM.js";import{C as E}from"./mod-Dzi2dmtd.js";const N=void 0,B=!!N&&!String(N).includes("REPLACE_WITH_"),V=()=>{const{id:j}=P(),[s,f]=i.useState(null),[y,v]=i.useState(!0),[w,m]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{const t=await k.getOrderById(j);f(t)}catch{h.error("Failed to load order details. Please try again.")}finally{v(!1)}})()},[j]),y?e.jsx("div",{className:"container mx-auto px-4 py-8 text-center",children:"Loading order details..."}):s?e.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-4xl",children:[e.jsxs(_,{children:[e.jsx("title",{children:"Order Details | SendUnlimitedEmail"}),e.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),e.jsx("div",{className:"mb-6",children:e.jsx(d,{variant:"ghost",asChild:!0,children:e.jsxs(p,{to:"/profile",className:"flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4"}),"Back to Orders"]})})}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between mb-6 md:mb-8 gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold mb-1 md:mb-2",children:"Order Details"}),e.jsxs("p",{className:"text-muted-foreground",children:["Order #",s.id??s._id]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Placed on ",new Date(s.created_at||s.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[(s.is_delivered??s.isDelivered)&&e.jsx(d,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs(p,{to:`/order/${s.id??s._id}/return`,className:"flex items-center gap-1.5",children:[e.jsx(A,{className:"w-3.5 h-3.5"})," Request Return"]})}),e.jsxs("div",{className:`flex items-center gap-2 px-4 py-2 rounded-full ${s.is_delivered??s.isDelivered?"bg-green-100 text-green-800":s.is_paid??s.isPaid?"bg-blue-100 text-blue-800":"bg-yellow-100 text-yellow-800"}`,children:[s.is_delivered??s.isDelivered?e.jsx(g,{className:"w-4 h-4"}):e.jsx(D,{className:"w-4 h-4"}),e.jsx("span",{className:"font-medium",children:s.is_delivered??s.isDelivered?"Delivered":s.is_paid??s.isPaid?"Processing":"Pending Payment"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(l,{children:[e.jsx(n,{children:e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(C,{className:"w-5 h-5"}),"Order Items"]})}),e.jsx(o,{children:e.jsx("div",{className:"space-y-4",children:(s.order_items??s.orderItems??[]).map((a,t)=>e.jsxs("div",{className:"flex gap-3 pb-4 border-b last:border-0",children:[e.jsx("img",{src:a.image||"/placeholder.svg",alt:a.name,className:"w-16 h-16 md:w-20 md:h-20 object-cover rounded-md flex-shrink-0",onError:u=>{u.target.src="/placeholder.svg"}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-medium text-sm md:text-base truncate",children:a.name}),a.condition&&a.condition!=="new"&&(()=>{const x={used:{label:"Used",cls:"bg-blue-100 text-blue-700"},open_box:{label:"Open Box",cls:"bg-amber-100 text-amber-700"},renewed:{label:"Renewed",cls:"bg-emerald-100 text-emerald-700"}}[a.condition];return x?e.jsx("span",{className:`inline-block text-xs font-semibold px-2 py-0.5 rounded-full ${x.cls} mb-1`,children:x.label}):null})(),e.jsxs("p",{className:"text-xs md:text-sm text-muted-foreground",children:["Qty: ",a.qty??a.quantity??1]}),e.jsxs("p",{className:"text-xs md:text-sm font-medium mt-1",children:[e.jsx(r,{amount:a.price,fallbackMode:"code"})," each"]})]}),e.jsx("div",{className:"text-right flex-shrink-0",children:e.jsx(r,{amount:Number(a.price)*(a.qty||a.quantity||1),className:"text-sm font-bold md:text-base",fallbackMode:"code"})})]},t))})})]}),e.jsxs(l,{children:[e.jsx(n,{children:e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(M,{className:"w-5 h-5"}),"Shipping Address"]})}),e.jsx(o,{children:e.jsxs("p",{className:"text-sm",children:[(s.shipping_address??s.shippingAddress)?.address,e.jsx("br",{}),(s.shipping_address??s.shippingAddress)?.city,", ",(s.shipping_address??s.shippingAddress)?.postalCode??(s.shipping_address??s.shippingAddress)?.postal_code,e.jsx("br",{}),(s.shipping_address??s.shippingAddress)?.country]})})]}),e.jsxs(l,{children:[e.jsx(n,{children:e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(b,{className:"w-5 h-5"}),"Payment Information"]})}),e.jsxs(o,{children:[e.jsxs("p",{className:"text-sm mb-2",children:["Method: ",s.payment_method??s.paymentMethod]}),s.is_paid??s.isPaid?e.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[e.jsx(g,{className:"w-4 h-4"}),e.jsxs("span",{className:"text-sm",children:["Paid on ",new Date(s.paid_at??s.paidAt).toLocaleDateString()]})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-yellow-600 mb-3",children:"Payment Pending"}),!(s.is_delivered??s.isDelivered)&&(w?e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm font-semibold",children:"Pay Online Now"}),e.jsx("button",{onClick:()=>m(!1),className:"text-xs text-muted-foreground hover:underline",children:"Cancel"})]}),B?e.jsx(O,{orderId:s.id??s._id,amount:s.totalPrice??s.total_price??0,onSuccess:()=>{h.success("Payment successful! Your order is confirmed."),f(a=>({...a,is_paid:!0,paid_at:new Date().toISOString()})),m(!1)},onError:()=>h.error("Payment failed. Please try again.")}):e.jsxs("div",{className:"flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800",children:[e.jsx(E,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Online card payment is not configured for this store. Please pay in cash on delivery or contact the store."})]})]}):e.jsxs(d,{size:"sm",onClick:()=>m(!0),className:"mt-1",style:{background:"var(--brand-primary,#7c3aed)",color:"#fff"},children:[e.jsx(b,{className:"w-4 h-4 mr-2"}),"Pay Now Online"]}))]})]})]})]}),e.jsx("div",{className:"lg:col-span-1",children:e.jsxs(l,{children:[e.jsx(n,{children:e.jsx(c,{children:"Order Summary"})}),e.jsxs(o,{className:"space-y-4",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Items Price"}),e.jsx(r,{amount:s.itemsPrice??s.items_price??0,fallbackMode:"code"})]}),(s.taxPrice??s.tax_price??0)>0&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"VAT"}),e.jsx(r,{amount:s.taxPrice??s.tax_price??0,fallbackMode:"code"})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Shipping"}),e.jsx("span",{children:(s.shippingPrice??s.shipping_price)===0?"FREE":e.jsx(r,{amount:s.shippingPrice??s.shipping_price??0,fallbackMode:"code"})})]}),e.jsxs("div",{className:"border-t pt-4 flex justify-between font-bold text-lg",children:[e.jsx("span",{children:"Total"}),e.jsx(r,{amount:s.totalPrice??s.total_price??0,fallbackMode:"code"})]})]})]})})]})]}):e.jsxs("div",{className:"container mx-auto px-4 py-8 text-center",children:[e.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Order Not Found"}),e.jsx(d,{asChild:!0,children:e.jsx(p,{to:"/profile",children:"Back to Profile"})})]})};export{V as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.