import { r as __toESM } from "../_runtime.mjs"; import { n as require_jsx_runtime, r as require_react } from "../_libs/react+tanstack__react-query.mjs"; import { b as CircleCheck, l as PackageSearch, o as Search } from "../_libs/lucide-react.mjs"; //#region node_modules/.nitro/vite/services/ssr/assets/TrackingSection-Bpxb4PV7.js var import_react = /* @__PURE__ */ __toESM(require_react()); var import_jsx_runtime = require_jsx_runtime(); var trackingSteps = [ "Booked", "Picked Up", "In Transit", "At Hub", "Out For Delivery", "Delivered" ]; function TrackingSection() { const [awbNumber, setAwbNumber] = (0, import_react.useState)(""); const [lrNumber, setLrNumber] = (0, import_react.useState)(""); const [status, setStatus] = (0, import_react.useState)("idle"); const [error, setError] = (0, import_react.useState)(""); const handleSubmit = (event) => { event.preventDefault(); const awb = awbNumber.trim(); const lr = lrNumber.trim(); if (!awb && !lr) { setError("Please enter an AWB Number or LR Number."); setStatus("idle"); return; } setError(""); setStatus("found"); }; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: "bg-navy py-8 sm:py-12", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mx-auto max-w-5xl px-6", children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mx-auto max-w-3xl text-center", children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-semibold uppercase tracking-[0.22em] text-gold", children: "Shipment Visibility" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "mt-3 text-3xl font-bold text-white sm:text-4xl", children: "Track Your Shipment" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "gold-rule mx-auto mt-5", "aria-hidden": "true" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-5 text-base leading-relaxed text-white/80", children: "Enter your AWB Number or LR Number to check your shipment status." }) ] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { onSubmit: handleSubmit, className: "mx-auto mt-8 max-w-3xl rounded-lg bg-white p-6 shadow-sm sm:p-8", noValidate: true, children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid gap-5 md:grid-cols-2", children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "awbNumber", className: "mb-2 block text-sm font-semibold text-navy", children: "AWB Number" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PackageSearch, { className: "pointer-events-none absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-navy/40", "aria-hidden": "true" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { id: "awbNumber", name: "awbNumber", type: "text", value: awbNumber, onChange: (event) => setAwbNumber(event.target.value), placeholder: "Enter AWB Number", className: "w-full rounded-md border border-border bg-background py-3.5 pl-11 pr-4 text-sm text-navy outline-none transition focus:border-gold focus:ring-2 focus:ring-gold/30" })] })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: "lrNumber", className: "mb-2 block text-sm font-semibold text-navy", children: "LR Number" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { id: "lrNumber", name: "lrNumber", type: "text", value: lrNumber, onChange: (event) => setLrNumber(event.target.value), placeholder: "Enter LR Number", className: "w-full rounded-md border border-border bg-background py-3.5 px-4 text-sm text-navy outline-none transition focus:border-gold focus:ring-2 focus:ring-gold/30" })] })] }), error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-4 text-sm text-red-600", children: error }) : null, /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "submit", className: "mt-6 inline-flex w-full items-center justify-center gap-2 rounded-md bg-gold px-6 py-3.5 text-sm font-semibold text-navy-deep transition-colors hover:bg-gold-soft", children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Search, { className: "h-4 w-4", "aria-hidden": "true" }), "Track Shipment"] }) ] }), status === "found" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mx-auto mt-8 max-w-3xl rounded-lg bg-white p-6 shadow-sm sm:p-8", children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-4 border-b border-border pb-5 sm:flex-row sm:items-center sm:justify-between", children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-semibold uppercase tracking-[0.18em] text-gold", children: "Tracking Result" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "mt-2 text-xl font-bold text-navy", children: "Shipment Status" })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-sm text-muted-foreground", children: [awbNumber.trim() ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold text-navy", children: "AWB:" }), " ", awbNumber.trim() ] }) : null, lrNumber.trim() ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold text-navy", children: "LR:" }), " ", lrNumber.trim() ] }) : null] })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-7 space-y-5", children: trackingSteps.map((step, index) => { const isCurrent = index === 0; return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start gap-4", children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-center", children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `flex h-9 w-9 items-center justify-center rounded-full ${isCurrent ? "bg-gold text-navy-deep" : "border border-border bg-surface text-muted-foreground"}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CircleCheck, { className: "h-5 w-5" }) }), index < trackingSteps.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "mt-1 h-6 w-px bg-border" }) : null] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pt-1", children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: `text-sm font-semibold ${isCurrent ? "text-navy" : "text-muted-foreground"}`, children: step }), isCurrent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-1 text-xs text-muted-foreground", children: "Current shipment status" }) : null] })] }, step); }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-7 rounded-md bg-surface p-4 text-xs leading-relaxed text-muted-foreground", children: "This is currently a frontend demonstration. Live shipment status will be connected to the tracking system when the backend/API is available." }) ] }) : null ] }) }); } //#endregion export { TrackingSection as t };