PageSourceSearch

https://floraflor.lovable.app/assets/ShipmentTracking-BA0MHnyS.js

js floraflor.lovable.app collected 2026-10-03 03:32:10 UTC 5,400 bytes, 5 lines download raw bytes

1import{D as w,b as k,j as e,y as N,C as l,a as d,c as h,d as f,P as _,s as E}from"./index-RxDZGo8S.js";import{B as M}from"./badge-Kwp9j7fd.js";import{C as o}from"./circle-x-BzR8rTt0.js";import{U as P}from"./user-Bt8OpLg1.js";import{P as S}from"./phone-BqXZyssE.js";import{M as D}from"./map-pin-SZp2PROJ.js";import{C as T}from"./calendar-DWLwoYri.js";import{C as I}from"./clock-B-vpET2t.js";import{C as $}from"./circle-check-big-ubcqJ6vK.js";import{f as p}from"./format-DuJJlbci.js";import{e as j}from"./es-DhgJzuV8.js";const a={pending:{label:"Pendiente",variant:"secondary",icon:I,color:"bg-yellow-500"},assigned:{label:"Asignado",variant:"outline",icon:_,color:"bg-blue-500"},in_transit:{label:"En Tránsito",variant:"default",icon:N,color:"bg-primary"},delivered:{label:"Entregado",variant:"default",icon:$,color:"bg-green-500"},cancelled:{label:"Cancelado",variant:"destructive",icon:o,color:"bg-red-500"}},g=["pending","assigned","in_transit","delivered"];function R(){const{trackingCode:c}=w(),{data:s,isLoading:v,error:b}=k({queryKey:["shipment-tracking",c],queryFn:async()=>{const{data:t,error:n}=await E.from("shipments").select("*").eq("tracking_code",c).single();if(n)throw n;return t},enabled:!!c});if(v)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsxs("div",{className:"text-center",children:[e.jsx(N,{className:"h-12 w-12 animate-pulse text-primary mx-auto mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"Cargando información del envío..."})]})});if(b||!s)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsx(l,{className:"max-w-md w-full",children:e.jsxs(d,{className:"pt-6 text-center",children:[e.jsx(o,{className:"h-12 w-12 text-destructive mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-bold mb-2",children:"Envío no encontrado"}),e.jsxs("p",{className:"text-muted-foreground",children:["No pudimos encontrar un envío con el código ",e.jsx("span",{className:"font-mono font-bold",children:c})]})]})})});const r=s.status,y=a[r].icon,m=g.indexOf(r),x=r==="cancelled";return e.jsx("div",{className:"min-h-screen bg-background p-4 py-8",children:e.jsxs("div",{className:"max-w-lg mx-auto space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Seguimiento de Envío"}),e.jsx("p",{className:"font-mono text-lg text-primary font-bold",children:s.tracking_code})]}),e.jsxs(l,{children:[e.jsx(h,{className:"pb-2",children:e.jsxs(f,{className:"text-lg flex items-center justify-between",children:["Estado Actual",e.jsxs(M,{variant:a[r].variant,className:"gap-1 text-sm",children:[e.jsx(y,{className:"h-4 w-4"}),a[r].label]})]})}),e.jsxs(d,{children:[!x&&e.jsxs("div",{className:"relative mt-4",children:[e.jsx("div",{className:"absolute left-4 top-0 bottom-0 w-0.5 bg-muted"}),g.map((t,n)=>{const C=a[t].icon,i=n<=m,u=n===m;return e.jsxs("div",{className:"relative flex items-center gap-4 pb-6 last:pb-0",children:[e.jsx("div",{className:`
2                        relative z-10 w-8 h-8 rounded-full flex items-center justify-center
3                        ${i?a[t].color:"bg-muted"}
4                        ${u?"ring-4 ring-primary/20":""}
5                      `,children:e.jsx(C,{className:`h-4 w-4 ${i?"text-white":"text-muted-foreground"}`})}),e.jsxs("div",{children:[e.jsx("p",{className:`font-medium ${i?"":"text-muted-foreground"}`,children:a[t].label}),u&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Estado actual"})]})]},t)})]}),x&&e.jsxs("div",{className:"text-center py-4",children:[e.jsx(o,{className:"h-12 w-12 text-destructive mx-auto mb-2"}),e.jsx("p",{className:"text-muted-foreground",children:"Este envío ha sido cancelado"})]})]})]}),e.jsxs(l,{children:[e.jsx(h,{children:e.jsx(f,{className:"text-lg",children:"Información del Envío"})}),e.jsxs(d,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(P,{className:"h-5 w-5 text-muted-foreground mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.customer_name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Destinatario"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(S,{className:"h-5 w-5 text-muted-foreground mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.customer_phone}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Teléfono"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(D,{className:"h-5 w-5 text-muted-foreground mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.destination_address}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Dirección de entrega"})]})]}),s.delivery_date&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(T,{className:"h-5 w-5 text-muted-foreground mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:p(new Date(s.delivery_date),"dd 'de' MMMM 'de' yyyy",{locale:j})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Fecha estimada de entrega"})]})]})]})]}),e.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:["Última actualización: ",p(new Date(s.updated_at),"dd MMM yyyy 'a las' HH:mm",{locale:j})]})]})})}export{R 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.