PageSourceSearch

https://demotelemed.lovable.app/assets/TrackOrder-DsczDyIR.js

js demotelemed.lovable.app collected 2026-10-03 03:25:37 UTC 5,445 bytes, 6 lines download raw bytes

1import{c as X,j as e,r as l,v as k,q as w}from"./index-42OYDF60.js";import{L as S,T as C}from"./Layout-CvY-dOeA.js";import{I as h}from"./input-D0IjS33j.js";import{L as u}from"./label-BNvpn1fK.js";import{B as D}from"./button-EfpS49lo.js";import{P as I}from"./package-NwB09wg9.js";import{L}from"./loader-circle-C9c4MVet.js";import{S as O}from"./search-C7Y2SfZe.js";import{C as P}from"./clock-DQFeazs3.js";import{C as T}from"./circle-check-9IzNzBLR.js";import"./phone-CUz94ybs.js";import"./menu-CkpBHtij.js";import"./mail-T8cR2-w0.js";import"./dialog-BPqr1XfL.js";import"./trash-2-B3_ksNI2.js";import"./minus-LiessKcH.js";import"./plus-UlO-Lz9K.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const _=X("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),f=[{key:"pending",label:"Pending",icon:P},{key:"confirmed",label:"Confirmed",icon:T},{key:"shipped",label:"Shipped",icon:C},{key:"delivered",label:"Delivered",icon:_}],q=()=>{const[o,g]=l.useState(""),[c,j]=l.useState(""),[r,n]=l.useState(null),[i,d]=l.useState(""),[m,x]=l.useState(!1),N=async s=>{s.preventDefault(),d(""),x(!0);try{const{data:a,error:t}=await k.from("orders").select("*").eq("order_number",o.trim()).maybeSingle();if(t)throw t;if(!a){n(null),d("কোনো অর্ডার পাওয়া যায়নি — Order ID যাচাই করুন।");return}const p=c.replace(/\D/g,""),b=(a.customer_phone||"").replace(/\D/g,"");if(p&&!b.endsWith(p.slice(-9))){n(null),d("Phone number মিলছে না।");return}n(a)}catch(a){w.error(a.message||"ত্রুটি হয়েছে")}finally{x(!1)}},y=r?f.findIndex(s=>s.key===r.status):-1,v=(r==null?void 0:r.items)||[];return e.jsxs("div",{className:"container max-w-3xl mx-auto px-4 py-10 md:py-14",children:[e.jsxs("div",{className:"text-center space-y-4 mb-10 animate-fade-in-up",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full glass px-4 py-1.5 text-xs font-semibold text-accent-glow",children:[e.jsx(I,{className:"h-3.5 w-3.5"})," Order Tracking"]}),e.jsxs("h1",{className:"text-4xl md:text-6xl font-extrabold tracking-tight",children:[e.jsx("span",{className:"font-serif italic font-normal",children:"Track "}),e.jsx("span",{className:"gradient-hero-text",children:"Your Order"})]})]}),e.jsxs("form",{onSubmit:N,className:"glass-card rounded-3xl p-6 md:p-8 space-y-4",children:[e.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{children:"Order ID *"}),e.jsx(h,{value:o,onChange:s=>g(s.target.value),placeholder:"DRS-XXXXXX-XXXXXX",className:"glass"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{children:"Phone *"}),e.jsx(h,{value:c,onChange:s=>j(s.target.value),placeholder:"01XXXXXXXXX",className:"glass"})]})]}),e.jsxs(D,{disabled:m,className:"w-full gradient-primary rounded-xl h-12 font-bold shadow-glow",children:[m?e.jsx(L,{className:"h-4 w-4 animate-spin"}):e.jsx(O,{className:"h-4 w-4"})," Track Order"]}),i&&e.jsx("p",{className:"text-sm text-destructive text-center",children:i})]}),r&&e.jsxs("div",{className:"mt-8 glass-card rounded-3xl p-6 md:p-8 space-y-6 animate-fade-in-up",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Order ID"}),e.jsx("div",{className:"text-xl font-extrabold gradient-hero-text",children:r.order_number})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:new Date(r.created_at).toLocaleString()})]}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:f.map((s,a)=>{const t=a<=y;return e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("div",{className:`h-12 w-12 rounded-2xl flex items-center justify-center ${t?"gradient-primary text-primary-foreground shadow-glow":"glass border border-border/60 text-muted-foreground"}`,children:e.jsx(s.icon,{className:"h-5 w-5"})}),e.jsx("div",{className:`text-xs font-bold ${t?"text-foreground":"text-muted-foreground"}`,children:s.label})]},s.key)})}),e.jsxs("div",{className:"space-y-2",children:[v.map((s,a)=>e.jsxs("div",{className:"flex gap-3 rounded-xl glass p-3",children:[e.jsx("img",{src:s.image,alt:s.name,className:"h-12 w-12 rounded-lg object-cover"}),e.jsxs("div",{className:"flex-1 text-sm",children:[e.jsx("div",{className:"font-bold line-clamp-1",children:s.name}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Qty: ",s.quantity]})]}),e.jsxs("div",{className:"font-bold",children:["৳",s.price*s.quantity]})]},a)),e.jsxs("div",{className:"flex justify-between border-t border-border/40 pt-3 font-bold",children:[e.jsx("span",{children:"Total"}),e.jsxs("span",{className:"gradient-hero-text text-xl",children:["৳",Number(r.total).toLocaleStr
6ing()]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground pt-1",children:["Payment: ",e.jsx("span",{className:"uppercase font-bold",children:r.payment_method==="cod"?"Cash on Delivery":r.payment_method})]})]})]})]})},U=()=>e.jsx(S,{children:e.jsx(q,{})});export{U 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.