hey-pharmacist-ecommerce 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +84 -115
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -116
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterChips.tsx +54 -80
- package/src/components/OrderCard.tsx +89 -56
- package/src/hooks/useOrders.ts +1 -0
- package/src/screens/OrdersScreen.tsx +91 -148
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import globalAxios4 from 'axios';
|
|
|
4
4
|
import { Toaster, toast } from 'sonner';
|
|
5
5
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
6
6
|
import { motion, AnimatePresence } from 'framer-motion';
|
|
7
|
-
import { Heart, ShoppingCart, Sparkles, ShieldCheck, TrendingUp, Star, Search, ShoppingBag, ArrowUpDown, ChevronDown, LayoutGrid, LayoutList, SlidersHorizontal, X, Clock, Package, ArrowLeft, Check, Minus, Plus, Trash2, ArrowRight, CheckCircle2, Truck, Edit3, MapPin, CreditCard, Lock, PackageCheck, HeartPulse, EyeOff, Eye, Shield, UserPlus, Mail, Phone, LogOut,
|
|
7
|
+
import { Heart, ShoppingCart, Sparkles, ShieldCheck, TrendingUp, Star, Search, ShoppingBag, ArrowUpDown, ChevronDown, LayoutGrid, LayoutList, SlidersHorizontal, X, Clock, Package, ArrowLeft, Check, Minus, Plus, Trash2, ArrowRight, CheckCircle2, Truck, Edit3, MapPin, CreditCard, Lock, PackageCheck, HeartPulse, EyeOff, Eye, Shield, UserPlus, Mail, Phone, LogOut, Filter, ChevronLeft, ChevronRight, ArrowUpRight, Warehouse, BellRing, Crown, User, Grid, List, Menu, Facebook, Twitter, Instagram, ChevronUp, Shirt, Pill, Box, Globe, Home } from 'lucide-react';
|
|
8
8
|
import Image3 from 'next/image';
|
|
9
9
|
import { useRouter, useSearchParams } from 'next/navigation';
|
|
10
10
|
import dynamic from 'next/dynamic';
|
|
@@ -10206,29 +10206,43 @@ function ProfileScreen() {
|
|
|
10206
10206
|
)))));
|
|
10207
10207
|
}
|
|
10208
10208
|
function OrderCard({ order }) {
|
|
10209
|
-
const { buildPath } = useBasePath();
|
|
10210
10209
|
const config = order.orderStatus;
|
|
10210
|
+
const itemCount = order.items?.length || 0;
|
|
10211
|
+
const showPriceBreakdown = order.shippingCost && order.shippingCost > 0 || order.tax && order.tax > 0 || order.discountedAmount && order.discountedAmount > 0;
|
|
10211
10212
|
return /* @__PURE__ */ React21.createElement(
|
|
10212
10213
|
motion.div,
|
|
10213
10214
|
{
|
|
10214
10215
|
initial: { opacity: 0, y: 20 },
|
|
10215
10216
|
animate: { opacity: 1, y: 0 },
|
|
10216
|
-
|
|
10217
|
-
className: "bg-white rounded-2xl p-6 shadow-sm hover:shadow-xl transition-all duration-300 border border-gray-100"
|
|
10217
|
+
className: "rounded-lg border border-slate-200 bg-white p-4 shadow-sm hover:shadow-md transition-shadow"
|
|
10218
10218
|
},
|
|
10219
|
-
/* @__PURE__ */ React21.createElement("div", { className: "flex justify-between
|
|
10220
|
-
/* @__PURE__ */ React21.createElement("div", { className: "space-y-2 mb-4" }, order.items
|
|
10221
|
-
|
|
10222
|
-
|
|
10219
|
+
/* @__PURE__ */ React21.createElement("div", { className: "flex items-center justify-between mb-4 pb-4 border-b border-gray-200" }, /* @__PURE__ */ React21.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React21.createElement("h3", { className: "text-base font-bold text-slate-900" }, "Order #", order?._id?.slice(0, 8) || ""), /* @__PURE__ */ React21.createElement(Badge, { variant: config }, config), /* @__PURE__ */ React21.createElement("span", { className: "text-xs text-gray-500" }, formatDate(order.createdAt || /* @__PURE__ */ new Date(), "short"))), /* @__PURE__ */ React21.createElement("div", { className: "text-right" }, /* @__PURE__ */ React21.createElement("p", { className: "text-lg font-bold text-slate-900" }, formatPrice(order.grandTotal || 0)), itemCount > 0 && /* @__PURE__ */ React21.createElement("p", { className: "text-xs text-gray-500" }, itemCount, " ", itemCount === 1 ? "item" : "items"))),
|
|
10220
|
+
/* @__PURE__ */ React21.createElement("div", { className: "space-y-2 mb-4" }, order.items && order.items.length > 0 ? order.items.slice(0, 3).map((item) => {
|
|
10221
|
+
const itemPrice = item.productVariantData?.finalPrice || 0;
|
|
10222
|
+
const itemTotal = itemPrice * item.quantity;
|
|
10223
|
+
return /* @__PURE__ */ React21.createElement("div", { key: item.productVariantId || item._id, className: "flex items-center gap-2 text-sm" }, /* @__PURE__ */ React21.createElement("div", { className: "relative w-12 h-12 rounded bg-gray-100 flex-shrink-0 overflow-hidden" }, /* @__PURE__ */ React21.createElement(
|
|
10224
|
+
Image3,
|
|
10225
|
+
{
|
|
10226
|
+
src: item?.productVariantData?.productMedia?.[0]?.file || "/placeholder-product.jpg",
|
|
10227
|
+
alt: item?.productVariantData?.name || "Product image",
|
|
10228
|
+
fill: true,
|
|
10229
|
+
className: "object-cover",
|
|
10230
|
+
sizes: "48px"
|
|
10231
|
+
}
|
|
10232
|
+
)), /* @__PURE__ */ React21.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React21.createElement("p", { className: "font-medium text-slate-900 truncate text-sm" }, item.productVariantData?.name || "Unknown Product"), /* @__PURE__ */ React21.createElement("p", { className: "text-xs text-gray-500" }, "Qty: ", item.quantity)), /* @__PURE__ */ React21.createElement("p", { className: "font-semibold text-slate-900 text-sm" }, formatPrice(itemTotal)));
|
|
10233
|
+
}) : /* @__PURE__ */ React21.createElement("p", { className: "text-sm text-gray-500 text-center py-2" }, "No items found"), order.items && order.items.length > 3 && /* @__PURE__ */ React21.createElement("p", { className: "text-xs text-gray-500 text-center pt-1" }, "+", order.items.length - 3, " more ", order.items.length - 3 === 1 ? "item" : "items")),
|
|
10234
|
+
showPriceBreakdown && /* @__PURE__ */ React21.createElement("div", { className: "mb-4 pb-4 border-b border-gray-200 space-y-1 text-xs" }, order.shippingCost !== void 0 && order.shippingCost > 0 && /* @__PURE__ */ React21.createElement("div", { className: "flex justify-between text-gray-600" }, /* @__PURE__ */ React21.createElement("span", null, "Shipping"), /* @__PURE__ */ React21.createElement("span", null, formatPrice(order.shippingCost))), order.tax !== void 0 && order.tax > 0 && /* @__PURE__ */ React21.createElement("div", { className: "flex justify-between text-gray-600" }, /* @__PURE__ */ React21.createElement("span", null, "Tax"), /* @__PURE__ */ React21.createElement("span", null, formatPrice(order.tax))), order.discountedAmount !== void 0 && order.discountedAmount > 0 && /* @__PURE__ */ React21.createElement("div", { className: "flex justify-between text-green-600" }, /* @__PURE__ */ React21.createElement("span", null, "Discount"), /* @__PURE__ */ React21.createElement("span", null, "-", formatPrice(order.discountedAmount)))),
|
|
10235
|
+
order.payment?.paymentStatus !== "Paid" /* Paid */ && order.payment?.paymentMethod === "Card" /* Card */ && /* @__PURE__ */ React21.createElement("div", { className: "flex justify-end" }, /* @__PURE__ */ React21.createElement(
|
|
10236
|
+
"button",
|
|
10223
10237
|
{
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
className: "inline-flex items-center gap-2
|
|
10238
|
+
onClick: () => {
|
|
10239
|
+
window.open(order?.payment?.hostedInvoiceUrl || "", "_blank");
|
|
10240
|
+
},
|
|
10241
|
+
className: "inline-flex items-center gap-2 rounded-full border-2 border-primary-500 bg-primary-500 hover:bg-primary-600 text-white px-4 py-2 text-sm font-medium transition-colors"
|
|
10228
10242
|
},
|
|
10229
10243
|
/* @__PURE__ */ React21.createElement(CreditCard, { className: "w-4 h-4" }),
|
|
10230
10244
|
"Pay Now"
|
|
10231
|
-
))
|
|
10245
|
+
))
|
|
10232
10246
|
);
|
|
10233
10247
|
}
|
|
10234
10248
|
function useOrders(page = 1, limit = 10, orderStatus, paymentStatus) {
|
|
@@ -10258,6 +10272,7 @@ function useOrders(page = 1, limit = 10, orderStatus, paymentStatus) {
|
|
|
10258
10272
|
resolvedUserId
|
|
10259
10273
|
);
|
|
10260
10274
|
setOrders(response.data.data || []);
|
|
10275
|
+
console.log(response.data);
|
|
10261
10276
|
setPagination({
|
|
10262
10277
|
page: response.data.page || page,
|
|
10263
10278
|
limit: response.data.limit || limit,
|
|
@@ -10335,9 +10350,7 @@ function FilterChips({
|
|
|
10335
10350
|
variant = "primary"
|
|
10336
10351
|
}) {
|
|
10337
10352
|
const [isOverflowOpen, setIsOverflowOpen] = useState(false);
|
|
10338
|
-
const [filterSearchTerm, setFilterSearchTerm] = useState("");
|
|
10339
10353
|
const overflowMenuRef = useRef(null);
|
|
10340
|
-
const color = variant === "primary" ? "primary" : "secondary";
|
|
10341
10354
|
const { visibleFilters, overflowFilters } = useMemo(() => {
|
|
10342
10355
|
const basePrimary = filters.slice(0, maxVisible);
|
|
10343
10356
|
if (basePrimary.includes(selected)) {
|
|
@@ -10358,17 +10371,6 @@ function FilterChips({
|
|
|
10358
10371
|
overflowFilters: filters.filter((filter) => !uniquePrimary.includes(filter))
|
|
10359
10372
|
};
|
|
10360
10373
|
}, [filters, maxVisible, selected]);
|
|
10361
|
-
const filteredOverflowFilters = useMemo(() => {
|
|
10362
|
-
if (!filterSearchTerm.trim()) return overflowFilters;
|
|
10363
|
-
return overflowFilters.filter(
|
|
10364
|
-
(filter) => filter.toLowerCase().includes(filterSearchTerm.toLowerCase())
|
|
10365
|
-
);
|
|
10366
|
-
}, [filterSearchTerm, overflowFilters]);
|
|
10367
|
-
useEffect(() => {
|
|
10368
|
-
if (!isOverflowOpen) {
|
|
10369
|
-
setFilterSearchTerm("");
|
|
10370
|
-
}
|
|
10371
|
-
}, [isOverflowOpen]);
|
|
10372
10374
|
useEffect(() => {
|
|
10373
10375
|
function handleClickOutside(event) {
|
|
10374
10376
|
if (overflowMenuRef.current && !overflowMenuRef.current.contains(event.target)) {
|
|
@@ -10382,69 +10384,63 @@ function FilterChips({
|
|
|
10382
10384
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
10383
10385
|
};
|
|
10384
10386
|
}, [isOverflowOpen]);
|
|
10385
|
-
|
|
10387
|
+
const isPrimary = variant === "primary";
|
|
10388
|
+
return /* @__PURE__ */ React21.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React21.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React21.createElement(Icon, { className: "h-4 w-4 text-slate-500" }), /* @__PURE__ */ React21.createElement("span", { className: "text-sm font-medium text-slate-700" }, label), selected !== "All" && /* @__PURE__ */ React21.createElement(
|
|
10386
10389
|
"button",
|
|
10387
10390
|
{
|
|
10388
|
-
key: filter,
|
|
10389
10391
|
type: "button",
|
|
10390
|
-
onClick: () => onSelect(
|
|
10391
|
-
className:
|
|
10392
|
+
onClick: () => onSelect("All"),
|
|
10393
|
+
className: "ml-auto text-xs text-primary-600 hover:text-primary-700 font-medium"
|
|
10392
10394
|
},
|
|
10393
|
-
|
|
10394
|
-
))
|
|
10395
|
+
"Clear"
|
|
10396
|
+
)), /* @__PURE__ */ React21.createElement("div", { className: "flex flex-wrap items-center gap-2" }, visibleFilters.map((filter) => {
|
|
10397
|
+
const isSelected = selected === filter;
|
|
10398
|
+
return /* @__PURE__ */ React21.createElement(
|
|
10399
|
+
"button",
|
|
10400
|
+
{
|
|
10401
|
+
key: filter,
|
|
10402
|
+
type: "button",
|
|
10403
|
+
onClick: () => onSelect(filter),
|
|
10404
|
+
className: `inline-flex items-center gap-1.5 rounded-lg border px-3 py-1.5 text-sm font-medium transition-all whitespace-nowrap ${isSelected ? isPrimary ? "border-primary-500 bg-primary-500 text-white shadow-sm" : "border-secondary-500 bg-secondary-500 text-white shadow-sm" : "border-slate-200 bg-white text-slate-700 hover:border-slate-300 hover:bg-slate-50"}`
|
|
10405
|
+
},
|
|
10406
|
+
filter,
|
|
10407
|
+
isSelected && /* @__PURE__ */ React21.createElement(X, { className: "h-3.5 w-3.5" })
|
|
10408
|
+
);
|
|
10409
|
+
}), overflowFilters.length > 0 && /* @__PURE__ */ React21.createElement("div", { className: "relative", ref: overflowMenuRef }, /* @__PURE__ */ React21.createElement(
|
|
10395
10410
|
"button",
|
|
10396
10411
|
{
|
|
10397
10412
|
type: "button",
|
|
10398
10413
|
onClick: () => setIsOverflowOpen((prev) => !prev),
|
|
10399
|
-
className: `flex items-center gap-
|
|
10414
|
+
className: `inline-flex items-center gap-1.5 rounded-lg border px-3 py-1.5 text-sm font-medium transition-all whitespace-nowrap ${overflowFilters.includes(selected) ? isPrimary ? "border-primary-500 bg-primary-50 text-primary-700" : "border-secondary-500 bg-secondary-50 text-secondary-700" : "border-slate-200 bg-white text-slate-700 hover:border-slate-300 hover:bg-slate-50"}`
|
|
10400
10415
|
},
|
|
10401
10416
|
/* @__PURE__ */ React21.createElement("span", null, overflowFilters.includes(selected) ? selected : "More"),
|
|
10402
|
-
/* @__PURE__ */ React21.createElement(
|
|
10417
|
+
/* @__PURE__ */ React21.createElement(ChevronDown, { className: `h-3.5 w-3.5 transition-transform ${isOverflowOpen ? "rotate-180" : ""}` })
|
|
10403
10418
|
), /* @__PURE__ */ React21.createElement(AnimatePresence, null, isOverflowOpen && /* @__PURE__ */ React21.createElement(
|
|
10404
10419
|
motion.div,
|
|
10405
10420
|
{
|
|
10406
|
-
initial: { opacity: 0, y: 8 },
|
|
10407
|
-
animate: { opacity: 1, y: 0 },
|
|
10408
|
-
exit: { opacity: 0, y: 8 },
|
|
10421
|
+
initial: { opacity: 0, y: 8, scale: 0.95 },
|
|
10422
|
+
animate: { opacity: 1, y: 0, scale: 1 },
|
|
10423
|
+
exit: { opacity: 0, y: 8, scale: 0.95 },
|
|
10409
10424
|
transition: { duration: 0.15 },
|
|
10410
|
-
className: "absolute
|
|
10425
|
+
className: "absolute left-0 top-full z-50 mt-2 w-56 rounded-lg border border-slate-200 bg-white shadow-lg"
|
|
10411
10426
|
},
|
|
10412
|
-
/* @__PURE__ */ React21.createElement("div", { className: "
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
{
|
|
10425
|
-
key: filter,
|
|
10426
|
-
type: "button",
|
|
10427
|
-
onClick: () => {
|
|
10428
|
-
onSelect(filter);
|
|
10429
|
-
setIsOverflowOpen(false);
|
|
10430
|
-
},
|
|
10431
|
-
className: `flex w-full items-center justify-between rounded-xl px-3 py-2 text-sm font-medium transition ${selected === filter ? `bg-${color}-600 text-white shadow-lg shadow-${color}-500/30` : "text-slate-600 hover:bg-slate-100"}`
|
|
10432
|
-
},
|
|
10433
|
-
/* @__PURE__ */ React21.createElement("span", null, filter),
|
|
10434
|
-
selected === filter && /* @__PURE__ */ React21.createElement(Check, { className: "h-4 w-4" })
|
|
10435
|
-
)) : /* @__PURE__ */ React21.createElement("p", { className: "px-3 py-4 text-sm text-slate-500" }, "No items found.")),
|
|
10436
|
-
/* @__PURE__ */ React21.createElement("div", { className: "flex items-center justify-between gap-2 border-t border-slate-100 px-4 py-3" }, /* @__PURE__ */ React21.createElement("span", { className: "text-xs font-semibold uppercase tracking-wide text-slate-400" }, "Quick actions"), /* @__PURE__ */ React21.createElement(
|
|
10437
|
-
"button",
|
|
10438
|
-
{
|
|
10439
|
-
type: "button",
|
|
10440
|
-
onClick: () => {
|
|
10441
|
-
onSelect("All");
|
|
10442
|
-
setIsOverflowOpen(false);
|
|
10427
|
+
/* @__PURE__ */ React21.createElement("div", { className: "max-h-64 overflow-y-auto p-1.5" }, overflowFilters.map((filter) => {
|
|
10428
|
+
const isSelected = selected === filter;
|
|
10429
|
+
return /* @__PURE__ */ React21.createElement(
|
|
10430
|
+
"button",
|
|
10431
|
+
{
|
|
10432
|
+
key: filter,
|
|
10433
|
+
type: "button",
|
|
10434
|
+
onClick: () => {
|
|
10435
|
+
onSelect(filter);
|
|
10436
|
+
setIsOverflowOpen(false);
|
|
10437
|
+
},
|
|
10438
|
+
className: `flex w-full items-center justify-between rounded-md px-3 py-2 text-sm font-medium transition ${isSelected ? isPrimary ? "bg-primary-500 text-white" : "bg-secondary-500 text-white" : "text-slate-700 hover:bg-slate-100"}`
|
|
10443
10439
|
},
|
|
10444
|
-
|
|
10445
|
-
|
|
10446
|
-
|
|
10447
|
-
))
|
|
10440
|
+
/* @__PURE__ */ React21.createElement("span", null, filter),
|
|
10441
|
+
isSelected && /* @__PURE__ */ React21.createElement(Check, { className: "h-4 w-4" })
|
|
10442
|
+
);
|
|
10443
|
+
}))
|
|
10448
10444
|
)))));
|
|
10449
10445
|
}
|
|
10450
10446
|
var STATUS_FILTERS = ["All", ...Object.values(ManualOrderDTOOrderStatusEnum)];
|
|
@@ -10461,9 +10457,6 @@ function OrdersScreen() {
|
|
|
10461
10457
|
selectedFilter,
|
|
10462
10458
|
selectedPaymentFilter
|
|
10463
10459
|
);
|
|
10464
|
-
const [isOverflowOpen, setIsOverflowOpen] = useState(false);
|
|
10465
|
-
const [filterSearchTerm, setFilterSearchTerm] = useState("");
|
|
10466
|
-
const overflowMenuRef = useRef(null);
|
|
10467
10460
|
const filteredOrders = useMemo(() => {
|
|
10468
10461
|
return orders.filter((order) => {
|
|
10469
10462
|
const matchesStatus = selectedFilter === "All" || order?.orderStatus?.toLowerCase() === selectedFilter.toLowerCase();
|
|
@@ -10473,44 +10466,18 @@ function OrdersScreen() {
|
|
|
10473
10466
|
}, [orders, selectedFilter, selectedPaymentFilter]);
|
|
10474
10467
|
const hasOrders = filteredOrders.length > 0;
|
|
10475
10468
|
const MAX_VISIBLE_FILTERS = 4;
|
|
10476
|
-
|
|
10477
|
-
if (!isOverflowOpen) {
|
|
10478
|
-
setFilterSearchTerm("");
|
|
10479
|
-
}
|
|
10480
|
-
}, [isOverflowOpen]);
|
|
10481
|
-
useEffect(() => {
|
|
10482
|
-
function handleClickOutside(event) {
|
|
10483
|
-
if (overflowMenuRef.current && !overflowMenuRef.current.contains(event.target)) {
|
|
10484
|
-
setIsOverflowOpen(false);
|
|
10485
|
-
}
|
|
10486
|
-
}
|
|
10487
|
-
if (isOverflowOpen) {
|
|
10488
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
10489
|
-
}
|
|
10490
|
-
return () => {
|
|
10491
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
10492
|
-
};
|
|
10493
|
-
}, [isOverflowOpen]);
|
|
10494
|
-
return /* @__PURE__ */ React21.createElement("div", { className: "min-h-screen bg-slate-50" }, /* @__PURE__ */ React21.createElement("section", { className: "relative overflow-hidden bg-gradient-to-br from-[rgb(var(--header-from))] via-[rgb(var(--header-via))] to-[rgb(var(--header-to))] text-white mb-8" }, /* @__PURE__ */ React21.createElement("div", { className: "absolute inset-0 bg-[radial-gradient(circle_at_top_left,_rgba(255,255,255,0.35),_transparent_60%)]" }), /* @__PURE__ */ React21.createElement("div", { className: "relative container mx-auto px-4 py-16" }, /* @__PURE__ */ React21.createElement(
|
|
10469
|
+
return /* @__PURE__ */ React21.createElement("div", { className: "min-h-screen bg-white" }, /* @__PURE__ */ React21.createElement("div", { className: "container mx-auto px-4 py-8 max-w-6xl" }, /* @__PURE__ */ React21.createElement(
|
|
10495
10470
|
motion.div,
|
|
10496
10471
|
{
|
|
10497
10472
|
initial: { opacity: 0, y: 24 },
|
|
10498
10473
|
animate: { opacity: 1, y: 0 },
|
|
10499
10474
|
className: "space-y-6"
|
|
10500
10475
|
},
|
|
10501
|
-
/* @__PURE__ */ React21.createElement("
|
|
10502
|
-
/* @__PURE__ */ React21.createElement("div", { className: "
|
|
10503
|
-
))), /* @__PURE__ */ React21.createElement("div", { className: "relative -mt-16 pb-16 container mx-auto px-4" }, /* @__PURE__ */ React21.createElement("div", { className: "container mx-auto px-4" }, /* @__PURE__ */ React21.createElement(
|
|
10504
|
-
motion.div,
|
|
10505
|
-
{
|
|
10506
|
-
initial: { opacity: 0, y: 24 },
|
|
10507
|
-
animate: { opacity: 1, y: 0 },
|
|
10508
|
-
className: "rounded-3xl border border-slate-100 bg-white p-6 shadow-lg shadow-primary-50"
|
|
10509
|
-
},
|
|
10510
|
-
/* @__PURE__ */ React21.createElement("div", { className: "flex flex-col gap-4 md:flex-row md:items-center md:justify-between" }, /* @__PURE__ */ React21.createElement("div", { className: "flex items-center gap-3 text-sm text-slate-500" }, /* @__PURE__ */ React21.createElement(Sparkles, { className: "h-4 w-4 text-primary-500" }), /* @__PURE__ */ React21.createElement("span", null, "Explore your complete order archive with pharmacist notes.")), /* @__PURE__ */ React21.createElement("div", { className: "flex flex-col gap-4 md:items-end" }, /* @__PURE__ */ React21.createElement(
|
|
10476
|
+
/* @__PURE__ */ React21.createElement("div", { className: "mb-6" }, /* @__PURE__ */ React21.createElement("h1", { className: "text-2xl font-bold text-slate-900" }, "Orders"), /* @__PURE__ */ React21.createElement("p", { className: "text-sm text-gray-500 mt-1" }, filteredOrders.length, " ", filteredOrders.length === 1 ? "order" : "orders")),
|
|
10477
|
+
/* @__PURE__ */ React21.createElement("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6" }, /* @__PURE__ */ React21.createElement(
|
|
10511
10478
|
FilterChips,
|
|
10512
10479
|
{
|
|
10513
|
-
label: "Status
|
|
10480
|
+
label: "Order Status",
|
|
10514
10481
|
icon: Filter,
|
|
10515
10482
|
filters: STATUS_FILTERS,
|
|
10516
10483
|
selected: selectedFilter,
|
|
@@ -10524,7 +10491,7 @@ function OrdersScreen() {
|
|
|
10524
10491
|
), /* @__PURE__ */ React21.createElement(
|
|
10525
10492
|
FilterChips,
|
|
10526
10493
|
{
|
|
10527
|
-
label: "Payment
|
|
10494
|
+
label: "Payment Status",
|
|
10528
10495
|
icon: CreditCard,
|
|
10529
10496
|
filters: PAYMENT_FILTERS,
|
|
10530
10497
|
selected: selectedPaymentFilter,
|
|
@@ -10535,8 +10502,8 @@ function OrdersScreen() {
|
|
|
10535
10502
|
maxVisible: MAX_VISIBLE_FILTERS,
|
|
10536
10503
|
variant: "primary"
|
|
10537
10504
|
}
|
|
10538
|
-
))
|
|
10539
|
-
/* @__PURE__ */ React21.createElement("div", { className: "
|
|
10505
|
+
)),
|
|
10506
|
+
/* @__PURE__ */ React21.createElement("div", { className: "space-y-4" }, isLoading ? Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ React21.createElement(OrderCardSkeleton, { key: index })) : hasOrders ? filteredOrders.map((order) => /* @__PURE__ */ React21.createElement(OrderCard, { key: order.id, order })) : /* @__PURE__ */ React21.createElement(
|
|
10540
10507
|
EmptyState,
|
|
10541
10508
|
{
|
|
10542
10509
|
icon: Package,
|
|
@@ -10546,26 +10513,28 @@ function OrdersScreen() {
|
|
|
10546
10513
|
onAction: () => router.push(buildPath("/shop"))
|
|
10547
10514
|
}
|
|
10548
10515
|
)),
|
|
10549
|
-
!isLoading && pagination.totalPages > 1 && hasOrders && /* @__PURE__ */ React21.createElement("div", { className: "mt-
|
|
10516
|
+
!isLoading && pagination.totalPages > 1 && hasOrders && /* @__PURE__ */ React21.createElement("div", { className: "mt-8 flex flex-wrap items-center justify-center gap-4 pt-6 border-t border-gray-200" }, /* @__PURE__ */ React21.createElement(
|
|
10550
10517
|
Button,
|
|
10551
10518
|
{
|
|
10552
10519
|
variant: "outline",
|
|
10553
10520
|
onClick: () => setPage((current) => Math.max(1, current - 1)),
|
|
10554
|
-
disabled: page === 1
|
|
10521
|
+
disabled: page === 1,
|
|
10522
|
+
className: "rounded-full border-2 border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
|
|
10555
10523
|
},
|
|
10556
|
-
/* @__PURE__ */ React21.createElement(ChevronLeft, { className: "h-
|
|
10524
|
+
/* @__PURE__ */ React21.createElement(ChevronLeft, { className: "h-4 w-4 mr-2" }),
|
|
10557
10525
|
"Previous"
|
|
10558
|
-
), /* @__PURE__ */ React21.createElement("span", { className: "text-sm font-
|
|
10526
|
+
), /* @__PURE__ */ React21.createElement("span", { className: "text-sm font-medium text-slate-600" }, "Page ", page, " of ", pagination.totalPages), /* @__PURE__ */ React21.createElement(
|
|
10559
10527
|
Button,
|
|
10560
10528
|
{
|
|
10561
10529
|
variant: "outline",
|
|
10562
10530
|
onClick: () => setPage((current) => Math.min(pagination.totalPages, current + 1)),
|
|
10563
|
-
disabled: page === pagination.totalPages
|
|
10531
|
+
disabled: page === pagination.totalPages,
|
|
10532
|
+
className: "rounded-full border-2 border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
|
|
10564
10533
|
},
|
|
10565
10534
|
"Next",
|
|
10566
|
-
/* @__PURE__ */ React21.createElement(ChevronRight, { className: "h-
|
|
10535
|
+
/* @__PURE__ */ React21.createElement(ChevronRight, { className: "h-4 w-4 ml-2" })
|
|
10567
10536
|
))
|
|
10568
|
-
)))
|
|
10537
|
+
)));
|
|
10569
10538
|
}
|
|
10570
10539
|
function CurrentOrdersScreen() {
|
|
10571
10540
|
const router = useRouter();
|