hey-pharmacist-ecommerce 1.1.0 → 1.1.1
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.d.mts +48 -39
- package/dist/index.d.ts +48 -39
- package/dist/index.js +579 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +576 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -0
package/dist/index.mjs
CHANGED
|
@@ -4,11 +4,11 @@ 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, Sparkles, ShieldCheck, TrendingUp, Search, ArrowUpDown, ChevronDown, LayoutGrid, LayoutList, SlidersHorizontal, X, Clock, Package, ArrowLeft, ChevronRight, Shield, Truck, Award, Star, Check, Minus, Plus, ShoppingCart, Trash2, ShoppingBag, HeartPulse, BadgePercent, ArrowRight, Edit3, MapPin, CreditCard, Lock, PackageCheck, EyeOff, Eye, CheckCircle2, UserPlus, Mail, Phone, LogOut, Calendar, CalendarDays, Filter, ChevronLeft, ArrowUpRight, Warehouse, BellRing, Crown, User, Menu, Facebook, Twitter, Instagram, Globe, Home } from 'lucide-react';
|
|
7
|
+
import { Heart, Sparkles, ShieldCheck, TrendingUp, Search, ArrowUpDown, ChevronDown, LayoutGrid, LayoutList, SlidersHorizontal, X, Clock, Package, ArrowLeft, ChevronRight, Shield, Truck, Award, Star, Check, Minus, Plus, ShoppingCart, Trash2, ShoppingBag, HeartPulse, BadgePercent, ArrowRight, Edit3, MapPin, CreditCard, Lock, PackageCheck, EyeOff, Eye, CheckCircle2, UserPlus, Mail, Phone, LogOut, Calendar, CalendarDays, Filter, ChevronLeft, ArrowUpRight, Warehouse, BellRing, Crown, User, Grid, List, Menu, Facebook, Twitter, Instagram, 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';
|
|
11
|
-
import
|
|
11
|
+
import Link8 from 'next/link';
|
|
12
12
|
import { useForm } from 'react-hook-form';
|
|
13
13
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
14
14
|
import { z } from 'zod';
|
|
@@ -8312,7 +8312,7 @@ function ProductDetailScreen({ productId }) {
|
|
|
8312
8312
|
return /* @__PURE__ */ React19.createElement("div", { className: "min-h-screen bg-slate-50" }, /* @__PURE__ */ React19.createElement("div", { className: "container mx-auto px-4 py-16" }, /* @__PURE__ */ React19.createElement("div", { className: "grid gap-10 lg:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]" }, /* @__PURE__ */ React19.createElement("div", { className: "space-y-6" }, /* @__PURE__ */ React19.createElement("div", { className: "h-[520px] animate-pulse rounded-3xl bg-slate-200" }), /* @__PURE__ */ React19.createElement("div", { className: "grid grid-cols-3 gap-4" }, Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ React19.createElement("div", { key: index, className: "h-32 animate-pulse rounded-2xl bg-slate-200" })))), /* @__PURE__ */ React19.createElement("div", { className: "space-y-4 rounded-3xl bg-white p-6 shadow-sm" }, /* @__PURE__ */ React19.createElement("div", { className: "h-8 w-32 animate-pulse rounded-full bg-slate-200" }), /* @__PURE__ */ React19.createElement("div", { className: "h-10 w-48 animate-pulse rounded-full bg-slate-200" }), /* @__PURE__ */ React19.createElement("div", { className: "h-6 w-full animate-pulse rounded-full bg-slate-200" }), /* @__PURE__ */ React19.createElement("div", { className: "h-12 w-full animate-pulse rounded-2xl bg-slate-200" }), /* @__PURE__ */ React19.createElement("div", { className: "h-12 w-full animate-pulse rounded-2xl bg-slate-200" })))));
|
|
8313
8313
|
}
|
|
8314
8314
|
if (!product) {
|
|
8315
|
-
return /* @__PURE__ */ React19.createElement("div", { className: "min-h-screen bg-slate-50" }, /* @__PURE__ */ React19.createElement("div", { className: "container mx-auto px-4 py-16" }, /* @__PURE__ */ React19.createElement("div", { className: "rounded-3xl bg-white p-10 text-center shadow-sm" }, /* @__PURE__ */ React19.createElement(Sparkles, { className: "mx-auto h-10 w-10 text-primary-500" }), /* @__PURE__ */ React19.createElement("h1", { className: "mt-6 text-2xl font-semibold text-gray-900" }, "Product not found"), /* @__PURE__ */ React19.createElement("p", { className: "mt-2 text-gray-600" }, "It may have been removed or is temporarily unavailable. Discover other pharmacy essentials in our catalogue."), /* @__PURE__ */ React19.createElement("div", { className: "mt-6" }, /* @__PURE__ */ React19.createElement(
|
|
8315
|
+
return /* @__PURE__ */ React19.createElement("div", { className: "min-h-screen bg-slate-50" }, /* @__PURE__ */ React19.createElement("div", { className: "container mx-auto px-4 py-16" }, /* @__PURE__ */ React19.createElement("div", { className: "rounded-3xl bg-white p-10 text-center shadow-sm" }, /* @__PURE__ */ React19.createElement(Sparkles, { className: "mx-auto h-10 w-10 text-primary-500" }), /* @__PURE__ */ React19.createElement("h1", { className: "mt-6 text-2xl font-semibold text-gray-900" }, "Product not found"), /* @__PURE__ */ React19.createElement("p", { className: "mt-2 text-gray-600" }, "It may have been removed or is temporarily unavailable. Discover other pharmacy essentials in our catalogue."), /* @__PURE__ */ React19.createElement("div", { className: "mt-6" }, /* @__PURE__ */ React19.createElement(Link8, { href: "/shop", className: "inline-block" }, /* @__PURE__ */ React19.createElement(Button, null, "Browse products"))))));
|
|
8316
8316
|
}
|
|
8317
8317
|
product.tags && product.tags.length > 0 ? product.tags.slice(0, 6) : ["Pharmacist approved", "Gentle on daily routines", "Backed by real customers"];
|
|
8318
8318
|
const highlightCards = [
|
|
@@ -8347,7 +8347,7 @@ function ProductDetailScreen({ productId }) {
|
|
|
8347
8347
|
},
|
|
8348
8348
|
/* @__PURE__ */ React19.createElement(ArrowLeft, { className: "h-5 w-5" }),
|
|
8349
8349
|
"Continue shopping"
|
|
8350
|
-
), /* @__PURE__ */ React19.createElement("div", { className: "hidden items-center gap-3 text-sm text-white/80 md:flex" }, /* @__PURE__ */ React19.createElement(
|
|
8350
|
+
), /* @__PURE__ */ React19.createElement("div", { className: "hidden items-center gap-3 text-sm text-white/80 md:flex" }, /* @__PURE__ */ React19.createElement(Link8, { href: "/", className: "transition hover:text-white" }, "Home"), /* @__PURE__ */ React19.createElement(ChevronRight, { className: "h-4 w-4" }), /* @__PURE__ */ React19.createElement(Link8, { href: "/shop", className: "transition hover:text-white" }, "Shop"), /* @__PURE__ */ React19.createElement(ChevronRight, { className: "h-4 w-4" }), /* @__PURE__ */ React19.createElement("span", { className: "truncate font-medium text-white" }, product.name))), /* @__PURE__ */ React19.createElement(
|
|
8351
8351
|
motion.div,
|
|
8352
8352
|
{
|
|
8353
8353
|
initial: { opacity: 0, y: 24 },
|
|
@@ -8485,7 +8485,7 @@ function ProductDetailScreen({ productId }) {
|
|
|
8485
8485
|
}
|
|
8486
8486
|
),
|
|
8487
8487
|
isFavorited ? "Saved" : "Save for later"
|
|
8488
|
-
))), /* @__PURE__ */ React19.createElement("div", { className: "rounded-3xl border border-primary-100 bg-primary-50/70 p-6 text-sm text-primary-700 shadow-sm" }, /* @__PURE__ */ React19.createElement("p", { className: "font-semibold uppercase tracking-[0.25em]" }, "Need advice?"), /* @__PURE__ */ React19.createElement("p", { className: "mt-2 leading-relaxed" }, "Chat with a pharmacist in real time before completing your purchase. We will help you choose supporting supplements and answer dosing questions.")))), relatedProducts.length > 0 && /* @__PURE__ */ React19.createElement("section", { className: "mt-20" }, /* @__PURE__ */ React19.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React19.createElement("div", null, /* @__PURE__ */ React19.createElement("h2", { className: "text-2xl font-semibold text-slate-900" }, "You may also like"), /* @__PURE__ */ React19.createElement("p", { className: "mt-1 text-sm text-slate-500" }, "Hand-picked recommendations that pair nicely with this product.")), /* @__PURE__ */ React19.createElement(
|
|
8488
|
+
))), /* @__PURE__ */ React19.createElement("div", { className: "rounded-3xl border border-primary-100 bg-primary-50/70 p-6 text-sm text-primary-700 shadow-sm" }, /* @__PURE__ */ React19.createElement("p", { className: "font-semibold uppercase tracking-[0.25em]" }, "Need advice?"), /* @__PURE__ */ React19.createElement("p", { className: "mt-2 leading-relaxed" }, "Chat with a pharmacist in real time before completing your purchase. We will help you choose supporting supplements and answer dosing questions.")))), relatedProducts.length > 0 && /* @__PURE__ */ React19.createElement("section", { className: "mt-20" }, /* @__PURE__ */ React19.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React19.createElement("div", null, /* @__PURE__ */ React19.createElement("h2", { className: "text-2xl font-semibold text-slate-900" }, "You may also like"), /* @__PURE__ */ React19.createElement("p", { className: "mt-1 text-sm text-slate-500" }, "Hand-picked recommendations that pair nicely with this product.")), /* @__PURE__ */ React19.createElement(Link8, { href: "/shop", className: "hidden md:inline-flex" }, /* @__PURE__ */ React19.createElement(Button, { variant: "ghost", className: "text-primary-600" }, "View all products"))), /* @__PURE__ */ React19.createElement("div", { className: "mt-6 grid gap-6 sm:grid-cols-2 lg:grid-cols-4" }, relatedProducts?.map((relatedProduct) => /* @__PURE__ */ React19.createElement(ProductCard, { key: relatedProduct.id, product: relatedProduct })))))));
|
|
8489
8489
|
}
|
|
8490
8490
|
function CartItem({ item }) {
|
|
8491
8491
|
const { updateQuantity, removeFromCart } = useCart();
|
|
@@ -9483,7 +9483,7 @@ function LoginScreen() {
|
|
|
9483
9483
|
/* @__PURE__ */ React19.createElement("div", { className: "space-y-6" }, /* @__PURE__ */ React19.createElement("span", { className: "inline-flex items-center gap-2 rounded-full bg-white/15 px-3 py-1 text-sm font-semibold uppercase tracking-[0.35em] text-white/70 backdrop-blur" }, /* @__PURE__ */ React19.createElement(HeartPulse, { className: "h-4 w-4" }), "Hey Pharmacist"), /* @__PURE__ */ React19.createElement("h1", { className: "text-4xl font-bold leading-tight lg:text-5xl" }, "Pharmacy-grade care for your household"), /* @__PURE__ */ React19.createElement("p", { className: "max-w-xl text-white/80" }, "Log in to unlock personalized regimens, pharmacist support, and fast delivery on wellness essentials curated just for you.")),
|
|
9484
9484
|
/* @__PURE__ */ React19.createElement("div", { className: "grid gap-4 rounded-3xl bg-white/10 p-6 backdrop-blur" }, /* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React19.createElement(ShieldCheck, { className: "h-5 w-5 text-white" }), /* @__PURE__ */ React19.createElement("p", { className: "text-sm text-white/80" }, "HIPAA-compliant security keeps your health information protected.")), /* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React19.createElement(Sparkles, { className: "h-5 w-5 text-white" }), /* @__PURE__ */ React19.createElement("p", { className: "text-sm text-white/80" }, "Pharmacists ready to chat in under 10 minutes for medication support."))),
|
|
9485
9485
|
/* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-6 text-sm text-white/80" }, /* @__PURE__ */ React19.createElement("span", null, "Need an account?"), /* @__PURE__ */ React19.createElement(
|
|
9486
|
-
|
|
9486
|
+
Link8,
|
|
9487
9487
|
{
|
|
9488
9488
|
href: "/register",
|
|
9489
9489
|
className: "inline-flex items-center gap-2 rounded-full bg-white/15 px-4 py-2 font-semibold transition hover:bg-white/25"
|
|
@@ -9532,7 +9532,7 @@ function LoginScreen() {
|
|
|
9532
9532
|
className: "h-4 w-4 rounded border-slate-300 text-primary-600 focus:ring-primary-500"
|
|
9533
9533
|
}
|
|
9534
9534
|
), "Remember me"), /* @__PURE__ */ React19.createElement(
|
|
9535
|
-
|
|
9535
|
+
Link8,
|
|
9536
9536
|
{
|
|
9537
9537
|
href: "/forgot-password",
|
|
9538
9538
|
className: "font-medium text-primary-600 transition hover:text-primary-700"
|
|
@@ -9608,7 +9608,7 @@ function RegisterScreen() {
|
|
|
9608
9608
|
/* @__PURE__ */ React19.createElement("div", { className: "space-y-6" }, /* @__PURE__ */ React19.createElement("span", { className: "inline-flex items-center gap-2 rounded-full bg-white/15 px-3 py-1 text-sm font-semibold uppercase tracking-[0.35em] text-white/70 backdrop-blur" }, /* @__PURE__ */ React19.createElement(HeartPulse, { className: "h-4 w-4" }), "Join Hey Pharmacist"), /* @__PURE__ */ React19.createElement("h1", { className: "text-4xl font-bold leading-tight lg:text-5xl" }, "Create your wellness account"), /* @__PURE__ */ React19.createElement("p", { className: "max-w-xl text-white/80" }, "Unlock concierge-level pharmacy support, curated product recommendations, and smarter refills designed for busy families.")),
|
|
9609
9609
|
/* @__PURE__ */ React19.createElement("div", { className: "space-y-4 rounded-3xl bg-white/10 p-6 backdrop-blur" }, BENEFITS.map((benefit) => /* @__PURE__ */ React19.createElement("div", { key: benefit, className: "flex items-center gap-3" }, /* @__PURE__ */ React19.createElement(CheckCircle2, { className: "h-5 w-5 text-white" }), /* @__PURE__ */ React19.createElement("p", { className: "text-sm text-white/85" }, benefit)))),
|
|
9610
9610
|
/* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-6 text-sm text-white/80" }, /* @__PURE__ */ React19.createElement("span", null, "Already part of the community?"), /* @__PURE__ */ React19.createElement(
|
|
9611
|
-
|
|
9611
|
+
Link8,
|
|
9612
9612
|
{
|
|
9613
9613
|
href: "/login",
|
|
9614
9614
|
className: "inline-flex items-center gap-2 rounded-full bg-white/15 px-4 py-2 font-semibold transition hover:bg-white/25"
|
|
@@ -9702,8 +9702,8 @@ function RegisterScreen() {
|
|
|
9702
9702
|
},
|
|
9703
9703
|
showConfirmPassword ? /* @__PURE__ */ React19.createElement(EyeOff, { className: "h-5 w-5" }) : /* @__PURE__ */ React19.createElement(Eye, { className: "h-5 w-5" })
|
|
9704
9704
|
)),
|
|
9705
|
-
/* @__PURE__ */ React19.createElement("div", { className: "flex items-start gap-3 rounded-2xl bg-slate-50 p-4 text-sm text-slate-600" }, /* @__PURE__ */ React19.createElement(Shield, { className: "mt-0.5 h-5 w-5 text-primary-500" }), /* @__PURE__ */ React19.createElement("span", null, "By creating an account, you agree to our", " ", /* @__PURE__ */ React19.createElement(
|
|
9706
|
-
|
|
9705
|
+
/* @__PURE__ */ React19.createElement("div", { className: "flex items-start gap-3 rounded-2xl bg-slate-50 p-4 text-sm text-slate-600" }, /* @__PURE__ */ React19.createElement(Shield, { className: "mt-0.5 h-5 w-5 text-primary-500" }), /* @__PURE__ */ React19.createElement("span", null, "By creating an account, you agree to our", " ", /* @__PURE__ */ React19.createElement(Link8, { href: "/terms", className: "font-semibold text-primary-600 hover:text-primary-700" }, "Terms of Service"), " ", "and", " ", /* @__PURE__ */ React19.createElement(
|
|
9706
|
+
Link8,
|
|
9707
9707
|
{
|
|
9708
9708
|
href: "/privacy",
|
|
9709
9709
|
className: "font-semibold text-primary-600 hover:text-primary-700"
|
|
@@ -9866,7 +9866,7 @@ function ProfileScreen() {
|
|
|
9866
9866
|
"View recent orders"
|
|
9867
9867
|
)))),
|
|
9868
9868
|
/* @__PURE__ */ React19.createElement("section", { className: "grid gap-4 md:grid-cols-2" }, quickLinks.map((item) => /* @__PURE__ */ React19.createElement(
|
|
9869
|
-
|
|
9869
|
+
Link8,
|
|
9870
9870
|
{
|
|
9871
9871
|
key: item.href,
|
|
9872
9872
|
href: item.href,
|
|
@@ -10287,7 +10287,7 @@ function CurrentOrdersScreen() {
|
|
|
10287
10287
|
},
|
|
10288
10288
|
/* @__PURE__ */ React19.createElement("p", { className: "text-sm font-semibold uppercase tracking-[0.35em] text-white/70" }, "Quick actions"),
|
|
10289
10289
|
/* @__PURE__ */ React19.createElement("div", { className: "mt-4 space-y-3 text-sm text-white/80" }, /* @__PURE__ */ React19.createElement(
|
|
10290
|
-
|
|
10290
|
+
Link8,
|
|
10291
10291
|
{
|
|
10292
10292
|
href: "/orders",
|
|
10293
10293
|
className: "flex items-center justify-between rounded-2xl bg-white/10 px-4 py-3 transition hover:bg-white/20"
|
|
@@ -10662,6 +10662,559 @@ You can add it back at any time.`
|
|
|
10662
10662
|
))), /* @__PURE__ */ React19.createElement("div", { className: "flex items-center justify-end gap-3" }, /* @__PURE__ */ React19.createElement(Button, { type: "button", variant: "outline", onClick: closeModal }, "Cancel"), /* @__PURE__ */ React19.createElement(Button, { type: "submit", isLoading: isSubmitting }, editingAddress ? "Save changes" : "Save address")))
|
|
10663
10663
|
));
|
|
10664
10664
|
}
|
|
10665
|
+
function useWishlistProducts(productIds = []) {
|
|
10666
|
+
const [products, setProducts] = useState([]);
|
|
10667
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
10668
|
+
const [error, setError] = useState(null);
|
|
10669
|
+
const [cache] = useState(() => /* @__PURE__ */ new Map());
|
|
10670
|
+
const uniqueIds = useMemo(
|
|
10671
|
+
() => Array.from(new Set((productIds || []).filter(Boolean))),
|
|
10672
|
+
[productIds]
|
|
10673
|
+
);
|
|
10674
|
+
const fetchProducts = useCallback(async () => {
|
|
10675
|
+
if (uniqueIds.length === 0) {
|
|
10676
|
+
setProducts([]);
|
|
10677
|
+
setIsLoading(false);
|
|
10678
|
+
setError(null);
|
|
10679
|
+
return;
|
|
10680
|
+
}
|
|
10681
|
+
setIsLoading(true);
|
|
10682
|
+
setError(null);
|
|
10683
|
+
try {
|
|
10684
|
+
const api = new ProductsApi(AXIOS_CONFIG);
|
|
10685
|
+
const results = await Promise.all(
|
|
10686
|
+
uniqueIds.map(async (id) => {
|
|
10687
|
+
if (cache.has(id)) return cache.get(id);
|
|
10688
|
+
const response = await api.getSingleProduct(id?._id || id || "");
|
|
10689
|
+
const product = response.data;
|
|
10690
|
+
cache.set(id, product);
|
|
10691
|
+
return product;
|
|
10692
|
+
})
|
|
10693
|
+
);
|
|
10694
|
+
setProducts(results);
|
|
10695
|
+
} catch (err) {
|
|
10696
|
+
setError(err);
|
|
10697
|
+
console.error("Failed to load wishlist products", err);
|
|
10698
|
+
} finally {
|
|
10699
|
+
setIsLoading(false);
|
|
10700
|
+
}
|
|
10701
|
+
}, [cache, uniqueIds]);
|
|
10702
|
+
useEffect(() => {
|
|
10703
|
+
fetchProducts();
|
|
10704
|
+
}, [fetchProducts]);
|
|
10705
|
+
return {
|
|
10706
|
+
products,
|
|
10707
|
+
isLoading,
|
|
10708
|
+
error,
|
|
10709
|
+
refetch: fetchProducts
|
|
10710
|
+
};
|
|
10711
|
+
}
|
|
10712
|
+
var SORT_OPTIONS = [
|
|
10713
|
+
{ value: "featured", label: "Most loved" },
|
|
10714
|
+
{ value: "price-low", label: "Price: Low to High" },
|
|
10715
|
+
{ value: "price-high", label: "Price: High to Low" },
|
|
10716
|
+
{ value: "name", label: "Name A-Z" },
|
|
10717
|
+
{ value: "availability", label: "Availability" }
|
|
10718
|
+
];
|
|
10719
|
+
function WishlistScreen() {
|
|
10720
|
+
const router = useRouter();
|
|
10721
|
+
const { isAuthenticated } = useAuth() || {};
|
|
10722
|
+
const {
|
|
10723
|
+
products: wishlistItems,
|
|
10724
|
+
removeFromWishlist,
|
|
10725
|
+
getWishlistCount,
|
|
10726
|
+
clearWishlist,
|
|
10727
|
+
refreshWishlist
|
|
10728
|
+
} = useWishlist();
|
|
10729
|
+
const wishlistCount = getWishlistCount?.() ?? 0;
|
|
10730
|
+
const { products: wishlistProducts, isLoading, error } = useWishlistProducts(
|
|
10731
|
+
wishlistItems
|
|
10732
|
+
);
|
|
10733
|
+
const [onlyInStock, setOnlyInStock] = useState(false);
|
|
10734
|
+
const [viewMode, setViewMode] = useState("list");
|
|
10735
|
+
const [sortOption, setSortOption] = useState("featured");
|
|
10736
|
+
useEffect(() => {
|
|
10737
|
+
if (error) {
|
|
10738
|
+
toast.error("We had trouble loading your saved products. Please try again.");
|
|
10739
|
+
}
|
|
10740
|
+
}, [error]);
|
|
10741
|
+
const handleRemoveFromWishlist = async (productId) => {
|
|
10742
|
+
try {
|
|
10743
|
+
await removeFromWishlist(productId);
|
|
10744
|
+
} catch (err) {
|
|
10745
|
+
console.error("Error removing from wishlist:", err);
|
|
10746
|
+
}
|
|
10747
|
+
};
|
|
10748
|
+
const handleClearWishlist = async () => {
|
|
10749
|
+
const confirmed = window.confirm("Clear all items from your wishlist?");
|
|
10750
|
+
if (!confirmed) return;
|
|
10751
|
+
try {
|
|
10752
|
+
await clearWishlist();
|
|
10753
|
+
await refreshWishlist();
|
|
10754
|
+
} catch (err) {
|
|
10755
|
+
console.error("Error clearing wishlist:", err);
|
|
10756
|
+
}
|
|
10757
|
+
};
|
|
10758
|
+
const totalValue = useMemo(
|
|
10759
|
+
() => wishlistProducts.reduce((sum, product) => sum + (product.finalPrice ?? 0), 0),
|
|
10760
|
+
[wishlistProducts]
|
|
10761
|
+
);
|
|
10762
|
+
useMemo(
|
|
10763
|
+
() => wishlistProducts.reduce((sum, product) => {
|
|
10764
|
+
const before = product.priceBeforeDiscount ?? product.finalPrice ?? 0;
|
|
10765
|
+
const after = product.finalPrice ?? 0;
|
|
10766
|
+
const savings = Math.max(before - after, 0);
|
|
10767
|
+
return sum + savings;
|
|
10768
|
+
}, 0),
|
|
10769
|
+
[wishlistProducts]
|
|
10770
|
+
);
|
|
10771
|
+
useMemo(
|
|
10772
|
+
() => wishlistProducts.filter((product) => (product.inventoryCount ?? 0) > 0).length,
|
|
10773
|
+
[wishlistProducts]
|
|
10774
|
+
);
|
|
10775
|
+
const processedProducts = useMemo(() => {
|
|
10776
|
+
let list = [...wishlistProducts];
|
|
10777
|
+
if (onlyInStock) {
|
|
10778
|
+
list = list.filter((product) => (product.inventoryCount ?? 0) > 0);
|
|
10779
|
+
}
|
|
10780
|
+
switch (sortOption) {
|
|
10781
|
+
case "price-low":
|
|
10782
|
+
list.sort((a, b) => (a.finalPrice ?? 0) - (b.finalPrice ?? 0));
|
|
10783
|
+
break;
|
|
10784
|
+
case "price-high":
|
|
10785
|
+
list.sort((a, b) => (b.finalPrice ?? 0) - (a.finalPrice ?? 0));
|
|
10786
|
+
break;
|
|
10787
|
+
case "name":
|
|
10788
|
+
list.sort((a, b) => (a.name || "").localeCompare(b.name || ""));
|
|
10789
|
+
break;
|
|
10790
|
+
case "availability":
|
|
10791
|
+
list.sort((a, b) => (b.inventoryCount ?? 0) - (a.inventoryCount ?? 0));
|
|
10792
|
+
break;
|
|
10793
|
+
case "featured":
|
|
10794
|
+
default:
|
|
10795
|
+
list.sort((a, b) => (b.totalSold ?? 0) - (a.totalSold ?? 0));
|
|
10796
|
+
break;
|
|
10797
|
+
}
|
|
10798
|
+
return list;
|
|
10799
|
+
}, [wishlistProducts, onlyInStock, sortOption]);
|
|
10800
|
+
const emptyAfterFiltering = !isLoading && wishlistProducts.length > 0 && processedProducts.length === 0;
|
|
10801
|
+
return /* @__PURE__ */ React19.createElement("div", { className: "min-h-screen bg-slate-50 pb-16" }, /* @__PURE__ */ React19.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))] pb-32 pt-16 text-white" }, /* @__PURE__ */ React19.createElement("div", { className: "absolute inset-0 opacity-40 mix-blend-soft-light", "aria-hidden": "true" }, /* @__PURE__ */ React19.createElement("div", { className: "absolute -top-1/2 right-1/2 h-[40rem] w-[40rem] rounded-full bg-white/10 blur-3xl" }), /* @__PURE__ */ React19.createElement("div", { className: "absolute left-1/4 top-1/4 h-48 w-48 rounded-full bg-white/20 blur-2xl" })), /* @__PURE__ */ React19.createElement("div", { className: "relative container mx-auto px-4" }, /* @__PURE__ */ React19.createElement("div", { className: "max-w-3xl space-y-6" }, /* @__PURE__ */ React19.createElement("span", { className: "inline-flex items-center gap-2 rounded-full bg-white/15 px-4 py-1 text-sm font-semibold uppercase tracking-[0.35em] text-white/70 backdrop-blur" }, /* @__PURE__ */ React19.createElement(Heart, { className: "h-4 w-4" }), "Wishlist"), /* @__PURE__ */ React19.createElement("h1", { className: "text-4xl font-bold leading-tight md:text-5xl" }, "Curate your pharmacy must-haves in one calming space"), /* @__PURE__ */ React19.createElement("p", { className: "max-w-2xl text-white/80 md:text-lg" }, "We keep your favourite products ready for reorder, refill reminders, and quick checkout\u2014exactly when you need them.")))), /* @__PURE__ */ React19.createElement("div", { className: "relative -mt-20" }, /* @__PURE__ */ React19.createElement("div", { className: "container mx-auto px-4" }, /* @__PURE__ */ React19.createElement(
|
|
10802
|
+
motion.div,
|
|
10803
|
+
{
|
|
10804
|
+
initial: { opacity: 0, y: 24 },
|
|
10805
|
+
animate: { opacity: 1, y: 0 },
|
|
10806
|
+
className: "rounded-3xl border border-slate-100 bg-white p-6 shadow-xl shadow-primary-50"
|
|
10807
|
+
},
|
|
10808
|
+
/* @__PURE__ */ React19.createElement("div", { className: "flex flex-col gap-6" }, !isAuthenticated && /* @__PURE__ */ React19.createElement("div", { className: "flex min-h-[40vh] items-center justify-center" }, /* @__PURE__ */ React19.createElement("div", { className: "max-w-lg rounded-3xl border border-slate-100 bg-white p-10 text-center shadow-lg shadow-primary-50" }, /* @__PURE__ */ React19.createElement("div", { className: "mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-primary-50 text-primary-600" }, /* @__PURE__ */ React19.createElement(Heart, { className: "h-8 w-8" })), /* @__PURE__ */ React19.createElement("h2", { className: "mt-6 text-3xl font-bold text-slate-900" }, "Sign in to see your favourites"), /* @__PURE__ */ React19.createElement("p", { className: "mt-3 text-slate-500" }, "Create your curated shelf of products and we'll keep them ready whenever you return."), /* @__PURE__ */ React19.createElement(Button, { className: "mt-6", onClick: () => router.push("/login") }, "Sign In"))), isAuthenticated && /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between" }, /* @__PURE__ */ React19.createElement("div", { className: "space-y-1" }, /* @__PURE__ */ React19.createElement("h2", { className: "text-2xl font-semibold text-slate-900" }, "Your saved collection"), /* @__PURE__ */ React19.createElement("p", { className: "text-sm text-slate-500" }, "Total value: ", /* @__PURE__ */ React19.createElement("span", { className: "font-semibold text-primary-600" }, formatPrice(totalValue)), onlyInStock && " \u2022 Showing items ready to ship")), /* @__PURE__ */ React19.createElement("div", { className: "flex flex-wrap items-center gap-3" }, /* @__PURE__ */ React19.createElement("label", { className: "inline-flex cursor-pointer items-center gap-2 rounded-full border border-slate-200 bg-slate-50 px-3 py-1.5 text-sm font-medium text-slate-600 transition hover:border-primary-200 hover:text-primary-600" }, /* @__PURE__ */ React19.createElement(
|
|
10809
|
+
"input",
|
|
10810
|
+
{
|
|
10811
|
+
type: "checkbox",
|
|
10812
|
+
checked: onlyInStock,
|
|
10813
|
+
onChange: (event) => setOnlyInStock(event.target.checked),
|
|
10814
|
+
className: "h-4 w-4 rounded border-slate-300 text-primary-600 focus:ring-primary-500"
|
|
10815
|
+
}
|
|
10816
|
+
), "Only show in-stock"), /* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-2 rounded-full border border-slate-200 bg-slate-50 px-3 py-1.5 text-sm text-slate-600" }, /* @__PURE__ */ React19.createElement("span", null, "Sort"), /* @__PURE__ */ React19.createElement(
|
|
10817
|
+
"select",
|
|
10818
|
+
{
|
|
10819
|
+
value: sortOption,
|
|
10820
|
+
onChange: (event) => setSortOption(event.target.value),
|
|
10821
|
+
className: "bg-transparent text-sm font-medium text-slate-700 outline-none"
|
|
10822
|
+
},
|
|
10823
|
+
SORT_OPTIONS.map((option) => /* @__PURE__ */ React19.createElement("option", { key: option.value, value: option.value }, option.label))
|
|
10824
|
+
)), /* @__PURE__ */ React19.createElement("div", { className: "flex overflow-hidden rounded-full border border-slate-200 bg-slate-50" }, /* @__PURE__ */ React19.createElement(
|
|
10825
|
+
"button",
|
|
10826
|
+
{
|
|
10827
|
+
type: "button",
|
|
10828
|
+
onClick: () => setViewMode("grid"),
|
|
10829
|
+
className: `flex items-center gap-1 px-3 py-1.5 text-sm font-medium transition ${viewMode === "grid" ? "bg-primary-600 text-white shadow-lg shadow-primary-500/30" : "text-slate-600 hover:bg-white"}`
|
|
10830
|
+
},
|
|
10831
|
+
/* @__PURE__ */ React19.createElement(Grid, { className: "h-4 w-4" }),
|
|
10832
|
+
"Grid"
|
|
10833
|
+
), /* @__PURE__ */ React19.createElement(
|
|
10834
|
+
"button",
|
|
10835
|
+
{
|
|
10836
|
+
type: "button",
|
|
10837
|
+
onClick: () => setViewMode("list"),
|
|
10838
|
+
className: `flex items-center gap-1 px-3 py-1.5 text-sm font-medium transition ${viewMode === "list" ? "bg-primary-600 text-white shadow-lg shadow-primary-500/30" : "text-slate-600 hover:bg-white"}`
|
|
10839
|
+
},
|
|
10840
|
+
/* @__PURE__ */ React19.createElement(List, { className: "h-4 w-4" }),
|
|
10841
|
+
"List"
|
|
10842
|
+
)), wishlistCount > 0 && /* @__PURE__ */ React19.createElement(
|
|
10843
|
+
Button,
|
|
10844
|
+
{
|
|
10845
|
+
variant: "ghost",
|
|
10846
|
+
className: "text-sm font-semibold text-slate-500 hover:text-red-500",
|
|
10847
|
+
onClick: handleClearWishlist
|
|
10848
|
+
},
|
|
10849
|
+
/* @__PURE__ */ React19.createElement(Trash2, { className: "h-4 w-4" }),
|
|
10850
|
+
"Clear all"
|
|
10851
|
+
))), isLoading && /* @__PURE__ */ React19.createElement("div", { className: "grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3" }, Array.from({ length: Math.min(wishlistCount || 3, 6) }).map((_, index) => /* @__PURE__ */ React19.createElement(
|
|
10852
|
+
"div",
|
|
10853
|
+
{
|
|
10854
|
+
key: index,
|
|
10855
|
+
className: "h-72 animate-pulse rounded-2xl border border-slate-200 bg-slate-100"
|
|
10856
|
+
}
|
|
10857
|
+
))), !isLoading && wishlistCount === 0 && /* @__PURE__ */ React19.createElement("div", { className: "flex min-h-[30vh] items-center justify-center" }, /* @__PURE__ */ React19.createElement("div", { className: "max-w-2xl rounded-3xl border border-slate-100 bg-white p-12 text-center shadow-xl shadow-primary-50" }, /* @__PURE__ */ React19.createElement("div", { className: "mx-auto flex h-20 w-20 items-center justify-center rounded-full bg-primary-100 text-primary-600" }, /* @__PURE__ */ React19.createElement(Sparkles, { className: "h-10 w-10" })), /* @__PURE__ */ React19.createElement("h2", { className: "mt-6 text-4xl font-bold text-slate-900" }, "Start your wellness wishlist"), /* @__PURE__ */ React19.createElement("p", { className: "mt-4 text-lg text-slate-500" }, "Bookmark pharmacy essentials, supplements, or skincare picks and we'll keep them safe until you're ready to checkout."), /* @__PURE__ */ React19.createElement("div", { className: "mt-8 flex flex-wrap justify-center gap-3" }, /* @__PURE__ */ React19.createElement(Button, { onClick: () => router.push("/shop") }, "Discover products"), /* @__PURE__ */ React19.createElement(Button, { variant: "outline", onClick: () => router.push("/categories") }, "Browse categories")))), !isLoading && processedProducts.length > 0 && /* @__PURE__ */ React19.createElement(React19.Fragment, null, viewMode === "grid" ? /* @__PURE__ */ React19.createElement(
|
|
10858
|
+
motion.div,
|
|
10859
|
+
{
|
|
10860
|
+
layout: true,
|
|
10861
|
+
className: "grid grid-cols-1 gap-5 sm:grid-cols-2 xl:grid-cols-3"
|
|
10862
|
+
},
|
|
10863
|
+
/* @__PURE__ */ React19.createElement(AnimatePresence, null, processedProducts.map((product) => /* @__PURE__ */ React19.createElement(
|
|
10864
|
+
motion.div,
|
|
10865
|
+
{
|
|
10866
|
+
key: product.id,
|
|
10867
|
+
layout: true,
|
|
10868
|
+
initial: { opacity: 0, y: 20 },
|
|
10869
|
+
animate: { opacity: 1, y: 0 },
|
|
10870
|
+
exit: { opacity: 0, y: -20 },
|
|
10871
|
+
transition: { duration: 0.2 }
|
|
10872
|
+
},
|
|
10873
|
+
/* @__PURE__ */ React19.createElement(
|
|
10874
|
+
ProductCard,
|
|
10875
|
+
{
|
|
10876
|
+
product,
|
|
10877
|
+
onClickProduct: (p) => router.push(`/products/${p.id}`),
|
|
10878
|
+
onFavorite: () => handleRemoveFromWishlist(product.id),
|
|
10879
|
+
isFavorited: true
|
|
10880
|
+
}
|
|
10881
|
+
)
|
|
10882
|
+
)))
|
|
10883
|
+
) : /* @__PURE__ */ React19.createElement(motion.div, { layout: true, className: "space-y-4" }, /* @__PURE__ */ React19.createElement(AnimatePresence, null, processedProducts.map((product) => /* @__PURE__ */ React19.createElement(
|
|
10884
|
+
motion.div,
|
|
10885
|
+
{
|
|
10886
|
+
key: product.id,
|
|
10887
|
+
layout: true,
|
|
10888
|
+
initial: { opacity: 0, y: 20 },
|
|
10889
|
+
animate: { opacity: 1, y: 0 },
|
|
10890
|
+
exit: { opacity: 0, y: -20 },
|
|
10891
|
+
transition: { duration: 0.2 },
|
|
10892
|
+
className: "flex flex-col gap-4 rounded-2xl border border-slate-100 bg-slate-50 p-4 shadow-sm shadow-primary-50 sm:flex-row sm:items-center"
|
|
10893
|
+
},
|
|
10894
|
+
/* @__PURE__ */ React19.createElement("div", { className: "relative h-28 w-full overflow-hidden rounded-2xl bg-white sm:w-40" }, /* @__PURE__ */ React19.createElement(
|
|
10895
|
+
Image3,
|
|
10896
|
+
{
|
|
10897
|
+
fill: true,
|
|
10898
|
+
src: product.productMedia?.[0]?.file || "/placeholder-product.jpg",
|
|
10899
|
+
alt: product.name || "Wishlist item",
|
|
10900
|
+
className: "h-full w-full object-cover"
|
|
10901
|
+
}
|
|
10902
|
+
)),
|
|
10903
|
+
/* @__PURE__ */ React19.createElement("div", { className: "flex flex-1 flex-col gap-2" }, /* @__PURE__ */ React19.createElement("div", { className: "flex flex-wrap items-center justify-between gap-3" }, /* @__PURE__ */ React19.createElement("div", null, /* @__PURE__ */ React19.createElement("h3", { className: "text-lg font-semibold text-slate-900" }, product.name), /* @__PURE__ */ React19.createElement("p", { className: "text-sm text-slate-500" }, product.parentCategories?.map((category) => category?.name).join(", ") || "General wellness")), /* @__PURE__ */ React19.createElement("div", { className: "text-right" }, /* @__PURE__ */ React19.createElement("p", { className: "text-lg font-bold text-primary-600" }, formatPrice(product.finalPrice ?? 0)), product.isDiscounted && /* @__PURE__ */ React19.createElement("p", { className: "text-xs text-emerald-500" }, "You save ", formatPrice(Math.max((product.priceBeforeDiscount ?? 0) - (product.finalPrice ?? 0), 0))))), /* @__PURE__ */ React19.createElement("div", { className: "flex flex-wrap items-center gap-3 text-xs text-slate-500" }, /* @__PURE__ */ React19.createElement("span", { className: `inline-flex items-center gap-1 rounded-full px-2.5 py-1 font-medium ${product.inventoryCount > 0 ? "bg-emerald-100 text-emerald-700" : "bg-rose-100 text-rose-700"}` }, /* @__PURE__ */ React19.createElement(Package, { className: "h-3.5 w-3.5" }), product.inventoryCount > 0 ? "In stock" : "Backordered"), product.totalSold > 0 && /* @__PURE__ */ React19.createElement("span", { className: "inline-flex items-center gap-1 rounded-full bg-slate-200 px-2.5 py-1 font-medium text-slate-700" }, /* @__PURE__ */ React19.createElement(Sparkles, { className: "h-3.5 w-3.5" }), product.totalSold, "+ purchased")), /* @__PURE__ */ React19.createElement("div", { className: "flex flex-wrap gap-2" }, /* @__PURE__ */ React19.createElement(
|
|
10904
|
+
Button,
|
|
10905
|
+
{
|
|
10906
|
+
size: "sm",
|
|
10907
|
+
onClick: () => router.push(`/products/${product.id}`)
|
|
10908
|
+
},
|
|
10909
|
+
"View details"
|
|
10910
|
+
), /* @__PURE__ */ React19.createElement(
|
|
10911
|
+
Button,
|
|
10912
|
+
{
|
|
10913
|
+
size: "sm",
|
|
10914
|
+
variant: "outline",
|
|
10915
|
+
onClick: () => handleRemoveFromWishlist(product.id),
|
|
10916
|
+
className: "text-primary-600"
|
|
10917
|
+
},
|
|
10918
|
+
"Remove"
|
|
10919
|
+
)))
|
|
10920
|
+
))))), isAuthenticated && emptyAfterFiltering && /* @__PURE__ */ React19.createElement("div", { className: "flex flex-col items-center justify-center rounded-2xl border border-dashed border-slate-200 bg-slate-50 p-12 text-center" }, /* @__PURE__ */ React19.createElement("div", { className: "flex h-16 w-16 items-center justify-center rounded-full bg-slate-200 text-slate-500" }, /* @__PURE__ */ React19.createElement(Package, { className: "h-8 w-8" })), /* @__PURE__ */ React19.createElement("h3", { className: "mt-6 text-2xl font-semibold text-slate-900" }, "Nothing matches those filters"), /* @__PURE__ */ React19.createElement("p", { className: "mt-2 max-w-md text-sm text-slate-500" }, "Try showing out-of-stock items or adjust your sort order to revisit everything you\u2019ve saved."), /* @__PURE__ */ React19.createElement(Button, { className: "mt-6", variant: "outline", onClick: () => setOnlyInStock(false) }, "Show all saved products"))))
|
|
10921
|
+
))));
|
|
10922
|
+
}
|
|
10923
|
+
function SearchPage() {
|
|
10924
|
+
const router = useRouter();
|
|
10925
|
+
const searchParams = useSearchParams();
|
|
10926
|
+
const searchQuery = searchParams.get("q") || "";
|
|
10927
|
+
const [products, setProducts] = useState([]);
|
|
10928
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
10929
|
+
const [searchInput, setSearchInput] = useState(searchQuery);
|
|
10930
|
+
const [hasSearched, setHasSearched] = useState(false);
|
|
10931
|
+
const { isInWishlist } = useWishlist();
|
|
10932
|
+
useEffect(() => {
|
|
10933
|
+
const fetchSearchResults = async () => {
|
|
10934
|
+
if (!searchQuery.trim()) {
|
|
10935
|
+
setProducts([]);
|
|
10936
|
+
setIsLoading(false);
|
|
10937
|
+
return;
|
|
10938
|
+
}
|
|
10939
|
+
try {
|
|
10940
|
+
setIsLoading(true);
|
|
10941
|
+
console.log(searchQuery);
|
|
10942
|
+
const api = new ProductsApi(AXIOS_CONFIG);
|
|
10943
|
+
const response = await api.getAllProductsForStore(
|
|
10944
|
+
searchQuery,
|
|
10945
|
+
void 0,
|
|
10946
|
+
// productType
|
|
10947
|
+
void 0,
|
|
10948
|
+
// categoryId
|
|
10949
|
+
void 0,
|
|
10950
|
+
// maxPrice
|
|
10951
|
+
void 0,
|
|
10952
|
+
// minPrice
|
|
10953
|
+
void 0,
|
|
10954
|
+
// brandFilter
|
|
10955
|
+
"in-stock",
|
|
10956
|
+
// availability
|
|
10957
|
+
"relevance",
|
|
10958
|
+
// sort
|
|
10959
|
+
true,
|
|
10960
|
+
// includeNoVariantProducts
|
|
10961
|
+
true,
|
|
10962
|
+
// isActive
|
|
10963
|
+
20,
|
|
10964
|
+
// limit
|
|
10965
|
+
1
|
|
10966
|
+
// page
|
|
10967
|
+
);
|
|
10968
|
+
if (response.data?.data) {
|
|
10969
|
+
const transformedProducts = response.data.data.map((item) => ({
|
|
10970
|
+
...item,
|
|
10971
|
+
id: item._id || ""
|
|
10972
|
+
}));
|
|
10973
|
+
setProducts(transformedProducts);
|
|
10974
|
+
} else {
|
|
10975
|
+
setProducts([]);
|
|
10976
|
+
}
|
|
10977
|
+
setHasSearched(true);
|
|
10978
|
+
} catch (error) {
|
|
10979
|
+
console.error("Error fetching search results:", error);
|
|
10980
|
+
setProducts([]);
|
|
10981
|
+
} finally {
|
|
10982
|
+
setIsLoading(false);
|
|
10983
|
+
}
|
|
10984
|
+
};
|
|
10985
|
+
fetchSearchResults();
|
|
10986
|
+
}, [searchQuery]);
|
|
10987
|
+
const handleSearch = (e) => {
|
|
10988
|
+
e.preventDefault();
|
|
10989
|
+
if (searchInput.trim()) {
|
|
10990
|
+
window.location.href = `/search?q=${encodeURIComponent(searchInput.trim())}`;
|
|
10991
|
+
}
|
|
10992
|
+
};
|
|
10993
|
+
const clearSearch = () => {
|
|
10994
|
+
setSearchInput("");
|
|
10995
|
+
};
|
|
10996
|
+
return /* @__PURE__ */ React.createElement("div", { className: "container mx-auto px-4 py-8" }, /* @__PURE__ */ React.createElement("div", { className: "max-w-2xl mx-auto mb-8" }, /* @__PURE__ */ React.createElement("form", { onSubmit: handleSearch, className: "relative" }, /* @__PURE__ */ React.createElement("div", { className: "relative" }, /* @__PURE__ */ React.createElement(Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400" }), /* @__PURE__ */ React.createElement(
|
|
10997
|
+
Input,
|
|
10998
|
+
{
|
|
10999
|
+
type: "text",
|
|
11000
|
+
value: searchInput,
|
|
11001
|
+
onChange: (e) => setSearchInput(e.target.value),
|
|
11002
|
+
placeholder: "Search for products...",
|
|
11003
|
+
className: "pl-10 pr-10 py-6 text-base rounded-lg border-gray-300 focus:ring-2 focus:ring-primary-500 focus:border-primary-500"
|
|
11004
|
+
}
|
|
11005
|
+
), searchInput && /* @__PURE__ */ React.createElement(
|
|
11006
|
+
"button",
|
|
11007
|
+
{
|
|
11008
|
+
type: "button",
|
|
11009
|
+
onClick: clearSearch,
|
|
11010
|
+
className: "absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600"
|
|
11011
|
+
},
|
|
11012
|
+
/* @__PURE__ */ React.createElement(X, { className: "h-5 w-5" })
|
|
11013
|
+
)), /* @__PURE__ */ React.createElement(
|
|
11014
|
+
"button",
|
|
11015
|
+
{
|
|
11016
|
+
type: "submit",
|
|
11017
|
+
className: "mt-4 w-full bg-primary-600 hover:bg-primary-700 text-white font-medium py-2 px-4 rounded-lg transition-colors"
|
|
11018
|
+
},
|
|
11019
|
+
"Search"
|
|
11020
|
+
))), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h1", { className: "text-2xl font-bold text-gray-900 mb-6" }, searchQuery ? `Search results for "${searchQuery}"` : "Search Products"), isLoading ? /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6" }, [...Array(8)].map((_, i) => /* @__PURE__ */ React.createElement("div", { key: i, className: "space-y-3" }, /* @__PURE__ */ React.createElement(Skeleton, { className: "h-48 w-full rounded-lg" }), /* @__PURE__ */ React.createElement(Skeleton, { className: "h-4 w-3/4" }), /* @__PURE__ */ React.createElement(Skeleton, { className: "h-4 w-1/2" })))) : products.length > 0 ? /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6" }, products.map((product) => /* @__PURE__ */ React.createElement(
|
|
11021
|
+
ProductCard,
|
|
11022
|
+
{
|
|
11023
|
+
product,
|
|
11024
|
+
isFavorited: isInWishlist(product.id),
|
|
11025
|
+
onClickProduct: (p) => router.push(`/products/${p.id}`)
|
|
11026
|
+
}
|
|
11027
|
+
))) : hasSearched ? /* @__PURE__ */ React.createElement("div", { className: "text-center py-12" }, /* @__PURE__ */ React.createElement("div", { className: "text-gray-500 text-lg mb-4" }, 'No products found for "', searchQuery, '"'), /* @__PURE__ */ React.createElement("p", { className: "text-gray-500 mb-6" }, "Try different keywords or check out our", " ", /* @__PURE__ */ React.createElement(Link8, { href: "/shop", className: "text-primary-600 hover:underline ml-1 font-medium" }, "featured products"))) : /* @__PURE__ */ React.createElement("div", { className: "text-center py-12" }, /* @__PURE__ */ React.createElement("p", { className: "text-gray-500" }, "Enter a search term to find products"))));
|
|
11028
|
+
}
|
|
11029
|
+
function CategoriesScreen() {
|
|
11030
|
+
const { categories, isLoading } = useCategories();
|
|
11031
|
+
const router = useRouter();
|
|
11032
|
+
return /* @__PURE__ */ React19.createElement("div", { className: "min-h-screen bg-slate-50" }, /* @__PURE__ */ React19.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__ */ React19.createElement("div", { className: "absolute inset-0 bg-[radial-gradient(circle_at_top_left,_rgba(255,255,255,0.35),_transparent_60%)]" }), /* @__PURE__ */ React19.createElement("div", { className: "relative container mx-auto px-4 py-16" }, /* @__PURE__ */ React19.createElement(
|
|
11033
|
+
motion.div,
|
|
11034
|
+
{
|
|
11035
|
+
initial: { opacity: 0, y: 24 },
|
|
11036
|
+
animate: { opacity: 1, y: 0 },
|
|
11037
|
+
className: "space-y-6"
|
|
11038
|
+
},
|
|
11039
|
+
/* @__PURE__ */ React19.createElement("span", { className: "inline-flex items-center gap-2 rounded-full bg-white/15 px-3 py-1 text-sm font-semibold uppercase tracking-[0.35em] text-white/70 backdrop-blur" }, /* @__PURE__ */ React19.createElement(Package, { className: "h-4 w-4" }), "Product Categories"),
|
|
11040
|
+
/* @__PURE__ */ React19.createElement("div", { className: "flex flex-col gap-4 md:flex-row md:items-center md:justify-between" }, /* @__PURE__ */ React19.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React19.createElement("h1", { className: "text-4xl font-bold md:text-5xl" }, "Browse Our Product Range"), /* @__PURE__ */ React19.createElement("p", { className: "max-w-2xl text-white/80 md:text-lg" }, "Explore our comprehensive selection of healthcare products, carefully curated by our pharmacists to meet all your wellness needs.")), /* @__PURE__ */ React19.createElement("div", { className: "rounded-3xl bg-white/15 p-6 backdrop-blur" }, /* @__PURE__ */ React19.createElement("p", { className: "text-sm font-semibold uppercase tracking-[0.35em] text-white/70" }, "Quick tip"), /* @__PURE__ */ React19.createElement("p", { className: "mt-3 text-sm text-white/80" }, "Use the categories below to quickly find the products you're looking for, or use the search function for specific items.")))
|
|
11041
|
+
))), /* @__PURE__ */ React19.createElement("div", { className: "relative -mt-16 pb-16" }, /* @__PURE__ */ React19.createElement("div", { className: "container mx-auto px-4" }, /* @__PURE__ */ React19.createElement(
|
|
11042
|
+
motion.div,
|
|
11043
|
+
{
|
|
11044
|
+
initial: { opacity: 0, y: 24 },
|
|
11045
|
+
animate: { opacity: 1, y: 0 },
|
|
11046
|
+
className: "rounded-3xl border border-slate-100 bg-white p-6 shadow-lg shadow-primary-50"
|
|
11047
|
+
},
|
|
11048
|
+
/* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-3 text-sm text-slate-500 mb-6" }, /* @__PURE__ */ React19.createElement(Sparkles, { className: "h-4 w-4 text-primary-500" }), /* @__PURE__ */ React19.createElement("span", null, "Browse our complete product catalog organized by categories.")),
|
|
11049
|
+
isLoading ? /* @__PURE__ */ React19.createElement("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6" }, [...Array(8)].map((_, i) => /* @__PURE__ */ React19.createElement("div", { key: i, className: "animate-pulse" }, /* @__PURE__ */ React19.createElement("div", { className: "bg-gray-200 rounded-lg aspect-square mb-2" }), /* @__PURE__ */ React19.createElement("div", { className: "h-4 bg-gray-200 rounded w-3/4 mb-1" }), /* @__PURE__ */ React19.createElement("div", { className: "h-3 bg-gray-200 rounded w-1/2" })))) : categories.length > 0 ? /* @__PURE__ */ React19.createElement("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6" }, categories.map((category) => /* @__PURE__ */ React19.createElement(
|
|
11050
|
+
Link8,
|
|
11051
|
+
{
|
|
11052
|
+
key: category.id,
|
|
11053
|
+
href: `/shop?category=${category.name}`,
|
|
11054
|
+
className: "group block overflow-hidden rounded-xl border border-gray-100 bg-white p-4 text-center transition hover:shadow-lg hover:border-primary-500"
|
|
11055
|
+
},
|
|
11056
|
+
/* @__PURE__ */ React19.createElement("div", { className: "relative aspect-square w-full overflow-hidden rounded-lg bg-gray-50 mb-3" }, category.image ? /* @__PURE__ */ React19.createElement(
|
|
11057
|
+
Image3,
|
|
11058
|
+
{
|
|
11059
|
+
src: category.image,
|
|
11060
|
+
alt: category.name || "Category Image",
|
|
11061
|
+
fill: true,
|
|
11062
|
+
className: "object-cover transition-transform group-hover:scale-105",
|
|
11063
|
+
sizes: "(max-width: 768px) 50vw, (max-width: 1200px) 33vw, 25vw"
|
|
11064
|
+
}
|
|
11065
|
+
) : /* @__PURE__ */ React19.createElement("div", { className: "flex h-full w-full items-center justify-center bg-gray-100 text-gray-400" }, /* @__PURE__ */ React19.createElement(Package, { className: "h-12 w-12" }))),
|
|
11066
|
+
/* @__PURE__ */ React19.createElement("h3", { className: "text-lg font-semibold text-gray-900 group-hover:text-primary-600 transition-colors" }, category.name),
|
|
11067
|
+
category.productCount > 0 && /* @__PURE__ */ React19.createElement("p", { className: "mt-1 text-sm text-gray-500" }, category.productCount, " ", category.productCount === 1 ? "product" : "products")
|
|
11068
|
+
))) : /* @__PURE__ */ React19.createElement(
|
|
11069
|
+
EmptyState,
|
|
11070
|
+
{
|
|
11071
|
+
title: "No categories found",
|
|
11072
|
+
description: "There are currently no product categories available.",
|
|
11073
|
+
icon: Package,
|
|
11074
|
+
actionLabel: "Shop products",
|
|
11075
|
+
onAction: () => router.push("/shop")
|
|
11076
|
+
}
|
|
11077
|
+
)
|
|
11078
|
+
))));
|
|
11079
|
+
}
|
|
11080
|
+
function NewAddressPage() {
|
|
11081
|
+
const router = useRouter();
|
|
11082
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
11083
|
+
const {
|
|
11084
|
+
register,
|
|
11085
|
+
handleSubmit,
|
|
11086
|
+
formState: { errors }
|
|
11087
|
+
} = useForm({
|
|
11088
|
+
resolver: zodResolver(addressSchema),
|
|
11089
|
+
defaultValues: {
|
|
11090
|
+
country: "United States"
|
|
11091
|
+
}
|
|
11092
|
+
});
|
|
11093
|
+
const onSubmit = async (data) => {
|
|
11094
|
+
setIsSubmitting(true);
|
|
11095
|
+
try {
|
|
11096
|
+
console.log("Submitting address data:", data);
|
|
11097
|
+
const api = new AddressesApi(AXIOS_CONFIG);
|
|
11098
|
+
const response = await api.createAddressForUser({
|
|
11099
|
+
name: data.name,
|
|
11100
|
+
street1: data.street1,
|
|
11101
|
+
street2: data.street2,
|
|
11102
|
+
city: data.city,
|
|
11103
|
+
state: data.state,
|
|
11104
|
+
zip: data.zip,
|
|
11105
|
+
country: data.country,
|
|
11106
|
+
phone: data.phone
|
|
11107
|
+
});
|
|
11108
|
+
toast.success("Address added successfully");
|
|
11109
|
+
router.back();
|
|
11110
|
+
} catch (error) {
|
|
11111
|
+
let errorMessage = "An unexpected error occurred";
|
|
11112
|
+
if (error.response?.data?.message) {
|
|
11113
|
+
errorMessage = error.response.data.message;
|
|
11114
|
+
} else if (error.message) {
|
|
11115
|
+
errorMessage = error.message;
|
|
11116
|
+
}
|
|
11117
|
+
if (error.response?.status === 400) {
|
|
11118
|
+
errorMessage = error.response.data?.message || "Please check your address details and try again";
|
|
11119
|
+
}
|
|
11120
|
+
if (error.message === "Network Error") {
|
|
11121
|
+
errorMessage = "Unable to connect to the server. Please check your internet connection.";
|
|
11122
|
+
}
|
|
11123
|
+
toast.error("Unable to save address", {
|
|
11124
|
+
description: errorMessage,
|
|
11125
|
+
duration: 5e3
|
|
11126
|
+
});
|
|
11127
|
+
if (error.response?.status === 422) {
|
|
11128
|
+
toast.info("Address validation failed", {
|
|
11129
|
+
description: "Make sure your address is complete and formatted correctly.",
|
|
11130
|
+
duration: 6e3
|
|
11131
|
+
});
|
|
11132
|
+
}
|
|
11133
|
+
} finally {
|
|
11134
|
+
setIsSubmitting(false);
|
|
11135
|
+
}
|
|
11136
|
+
};
|
|
11137
|
+
return /* @__PURE__ */ React.createElement("div", { className: "min-h-screen bg-slate-50" }, /* @__PURE__ */ React.createElement("div", { className: "relative bg-gradient-to-br from-[rgb(var(--header-from))] via-[rgb(var(--header-via))] to-[rgb(var(--header-to))] text-white" }, /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 bg-[radial-gradient(circle_at_top_left,_rgba(255,255,255,0.35),_transparent_60%)]" }), /* @__PURE__ */ React.createElement("div", { className: "relative container mx-auto px-4 py-8" }, /* @__PURE__ */ React.createElement(
|
|
11138
|
+
"button",
|
|
11139
|
+
{
|
|
11140
|
+
onClick: () => router.back(),
|
|
11141
|
+
className: "inline-flex items-center gap-2 rounded-lg bg-white/10 px-4 py-2 text-sm font-medium text-white hover:bg-white/20 transition-colors"
|
|
11142
|
+
},
|
|
11143
|
+
/* @__PURE__ */ React.createElement(ArrowLeft, { className: "h-4 w-4" }),
|
|
11144
|
+
"Back"
|
|
11145
|
+
), /* @__PURE__ */ React.createElement("div", { className: "mt-6 flex items-center gap-4" }, /* @__PURE__ */ React.createElement("div", { className: "rounded-full bg-white/10 p-3" }, /* @__PURE__ */ React.createElement(MapPin, { className: "h-6 w-6" })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h1", { className: "text-3xl font-bold" }, "Add New Address"), /* @__PURE__ */ React.createElement("p", { className: "mt-1 text-white/75" }, "Enter your delivery address details below."))))), /* @__PURE__ */ React.createElement("div", { className: "container mx-auto px-4 py-8" }, /* @__PURE__ */ React.createElement("div", { className: "max-w-2xl mx-auto" }, /* @__PURE__ */ React.createElement("div", { className: "bg-white rounded-2xl shadow-xl p-6" }, /* @__PURE__ */ React.createElement("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-6" }, /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4" }, /* @__PURE__ */ React.createElement(
|
|
11146
|
+
Input,
|
|
11147
|
+
{
|
|
11148
|
+
label: "Full name",
|
|
11149
|
+
placeholder: "John Doe",
|
|
11150
|
+
...register("name"),
|
|
11151
|
+
error: errors.name?.message
|
|
11152
|
+
}
|
|
11153
|
+
), /* @__PURE__ */ React.createElement(
|
|
11154
|
+
Input,
|
|
11155
|
+
{
|
|
11156
|
+
label: "Phone number",
|
|
11157
|
+
placeholder: "+1 (555) 123-4567",
|
|
11158
|
+
...register("phone"),
|
|
11159
|
+
error: errors.phone?.message
|
|
11160
|
+
}
|
|
11161
|
+
), /* @__PURE__ */ React.createElement("div", { className: "md:col-span-2" }, /* @__PURE__ */ React.createElement(
|
|
11162
|
+
Input,
|
|
11163
|
+
{
|
|
11164
|
+
label: "Address line 1",
|
|
11165
|
+
placeholder: "123 Main St",
|
|
11166
|
+
...register("street1"),
|
|
11167
|
+
error: errors.street1?.message
|
|
11168
|
+
}
|
|
11169
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "md:col-span-2" }, /* @__PURE__ */ React.createElement(
|
|
11170
|
+
Input,
|
|
11171
|
+
{
|
|
11172
|
+
label: "Address line 2 (optional)",
|
|
11173
|
+
placeholder: "Apt 4B",
|
|
11174
|
+
...register("street2")
|
|
11175
|
+
}
|
|
11176
|
+
)), /* @__PURE__ */ React.createElement(
|
|
11177
|
+
Input,
|
|
11178
|
+
{
|
|
11179
|
+
label: "City",
|
|
11180
|
+
placeholder: "New York",
|
|
11181
|
+
...register("city"),
|
|
11182
|
+
error: errors.city?.message
|
|
11183
|
+
}
|
|
11184
|
+
), /* @__PURE__ */ React.createElement(
|
|
11185
|
+
Input,
|
|
11186
|
+
{
|
|
11187
|
+
label: "State",
|
|
11188
|
+
placeholder: "NY",
|
|
11189
|
+
...register("state"),
|
|
11190
|
+
error: errors.state?.message
|
|
11191
|
+
}
|
|
11192
|
+
), /* @__PURE__ */ React.createElement(
|
|
11193
|
+
Input,
|
|
11194
|
+
{
|
|
11195
|
+
label: "ZIP code",
|
|
11196
|
+
placeholder: "10001",
|
|
11197
|
+
...register("zip"),
|
|
11198
|
+
error: errors.zip?.message
|
|
11199
|
+
}
|
|
11200
|
+
), /* @__PURE__ */ React.createElement(
|
|
11201
|
+
Input,
|
|
11202
|
+
{
|
|
11203
|
+
label: "Country",
|
|
11204
|
+
placeholder: "United States",
|
|
11205
|
+
...register("country"),
|
|
11206
|
+
error: errors.country?.message
|
|
11207
|
+
}
|
|
11208
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "flex justify-end gap-4" }, /* @__PURE__ */ React.createElement(
|
|
11209
|
+
Button,
|
|
11210
|
+
{
|
|
11211
|
+
type: "button",
|
|
11212
|
+
variant: "outline",
|
|
11213
|
+
onClick: () => router.back()
|
|
11214
|
+
},
|
|
11215
|
+
"Cancel"
|
|
11216
|
+
), /* @__PURE__ */ React.createElement(Button, { type: "submit", disabled: isSubmitting }, isSubmitting ? "Adding Address..." : "Add Address")))))));
|
|
11217
|
+
}
|
|
10665
11218
|
function Header() {
|
|
10666
11219
|
const { config } = useTheme();
|
|
10667
11220
|
const { user, isAuthenticated } = useAuth();
|
|
@@ -10678,7 +11231,7 @@ function Header() {
|
|
|
10678
11231
|
{ href: "/about", label: "About" },
|
|
10679
11232
|
{ href: "/contact", label: "Contact" }
|
|
10680
11233
|
];
|
|
10681
|
-
return /* @__PURE__ */ React19.createElement("header", { className: "sticky top-0 z-40 bg-white/80 backdrop-blur-xl border-b border-gray-200 shadow-sm" }, /* @__PURE__ */ React19.createElement("div", { className: "container mx-auto px-4" }, /* @__PURE__ */ React19.createElement("div", { className: "flex items-center justify-between h-20" }, /* @__PURE__ */ React19.createElement(
|
|
11234
|
+
return /* @__PURE__ */ React19.createElement("header", { className: "sticky top-0 z-40 bg-white/80 backdrop-blur-xl border-b border-gray-200 shadow-sm" }, /* @__PURE__ */ React19.createElement("div", { className: "container mx-auto px-4" }, /* @__PURE__ */ React19.createElement("div", { className: "flex items-center justify-between h-20" }, /* @__PURE__ */ React19.createElement(Link8, { href: "/", className: "flex items-center gap-3" }, /* @__PURE__ */ React19.createElement("div", { className: "relative w-12 h-12" }, /* @__PURE__ */ React19.createElement(
|
|
10682
11235
|
Image3,
|
|
10683
11236
|
{
|
|
10684
11237
|
src: config.logo,
|
|
@@ -10687,7 +11240,7 @@ function Header() {
|
|
|
10687
11240
|
className: "object-contain"
|
|
10688
11241
|
}
|
|
10689
11242
|
)), /* @__PURE__ */ React19.createElement("span", { className: "text-2xl font-bold text-gray-900 hidden sm:block" }, config.storeName)), /* @__PURE__ */ React19.createElement("nav", { className: "hidden lg:flex items-center gap-8" }, navLinks.map((link) => /* @__PURE__ */ React19.createElement(
|
|
10690
|
-
|
|
11243
|
+
Link8,
|
|
10691
11244
|
{
|
|
10692
11245
|
key: link.href,
|
|
10693
11246
|
href: link.href,
|
|
@@ -10734,15 +11287,15 @@ function Header() {
|
|
|
10734
11287
|
},
|
|
10735
11288
|
/* @__PURE__ */ React19.createElement(X, { className: "w-4 h-4" })
|
|
10736
11289
|
))
|
|
10737
|
-
))), /* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React19.createElement(
|
|
10738
|
-
|
|
11290
|
+
))), /* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React19.createElement(Link8, { href: "/wishlist", className: "relative p-2 text-gray-700 hover:text-red-500 transition-colors" }, /* @__PURE__ */ React19.createElement(Heart, { className: "w-6 h-6" }), wishlistCount > 0 && /* @__PURE__ */ React19.createElement("span", { className: "absolute -top-1 -right-1 bg-red-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center" }, wishlistCount)), /* @__PURE__ */ React19.createElement(Link8, { href: "/cart", className: "relative p-2 text-gray-700 hover:text-primary-600 transition-colors" }, /* @__PURE__ */ React19.createElement(ShoppingCart, { className: "w-6 h-6" }), cart?.cartBody?.items?.length && cart.cartBody?.items?.length > 0 ? /* @__PURE__ */ React19.createElement("span", { className: "absolute -top-1 -right-1 bg-red-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center" }, cart.cartBody?.items?.length) : null), isAuthenticated ? /* @__PURE__ */ React19.createElement(
|
|
11291
|
+
Link8,
|
|
10739
11292
|
{
|
|
10740
11293
|
href: "/account",
|
|
10741
11294
|
className: "p-2 hover:bg-gray-100 rounded-lg transition-colors"
|
|
10742
11295
|
},
|
|
10743
11296
|
/* @__PURE__ */ React19.createElement(User, { className: "w-6 h-6 text-gray-700" })
|
|
10744
11297
|
) : /* @__PURE__ */ React19.createElement(
|
|
10745
|
-
|
|
11298
|
+
Link8,
|
|
10746
11299
|
{
|
|
10747
11300
|
href: "/login",
|
|
10748
11301
|
className: "hidden sm:block px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 transition-colors font-medium"
|
|
@@ -10764,7 +11317,7 @@ function Header() {
|
|
|
10764
11317
|
className: "lg:hidden overflow-hidden border-t border-gray-200"
|
|
10765
11318
|
},
|
|
10766
11319
|
/* @__PURE__ */ React19.createElement("nav", { className: "flex flex-col gap-1 py-2" }, navLinks.map((link) => /* @__PURE__ */ React19.createElement(
|
|
10767
|
-
|
|
11320
|
+
Link8,
|
|
10768
11321
|
{
|
|
10769
11322
|
key: link.href,
|
|
10770
11323
|
href: link.href,
|
|
@@ -10773,7 +11326,7 @@ function Header() {
|
|
|
10773
11326
|
},
|
|
10774
11327
|
link.label
|
|
10775
11328
|
)), !isAuthenticated && /* @__PURE__ */ React19.createElement(
|
|
10776
|
-
|
|
11329
|
+
Link8,
|
|
10777
11330
|
{
|
|
10778
11331
|
href: "/login",
|
|
10779
11332
|
onClick: () => setIsMobileMenuOpen(false),
|
|
@@ -10805,21 +11358,21 @@ function Footer() {
|
|
|
10805
11358
|
{ label: "Returns", href: "/returns" }
|
|
10806
11359
|
]};
|
|
10807
11360
|
return /* @__PURE__ */ React19.createElement("footer", { className: "bg-gray-900 text-gray-300" }, /* @__PURE__ */ React19.createElement("div", { className: "container mx-auto px-4 py-16" }, /* @__PURE__ */ React19.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-12" }, /* @__PURE__ */ React19.createElement("div", { className: "lg:col-span-2" }, /* @__PURE__ */ React19.createElement("h3", { className: "text-2xl font-bold text-white mb-4" }, config.storeName), /* @__PURE__ */ React19.createElement("p", { className: "text-gray-400 mb-6 max-w-md" }, "Your trusted online store for quality products. We deliver excellence with every order."), /* @__PURE__ */ React19.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React19.createElement(Mail, { className: "w-5 h-5 text-primary-500" }), /* @__PURE__ */ React19.createElement("span", null, "support@", config.storeName.toLowerCase().replace(/\s+/g, ""), ".com")), /* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React19.createElement(Phone, { className: "w-5 h-5 text-primary-500" }), /* @__PURE__ */ React19.createElement("span", null, "+1 (555) 123-4567")), /* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React19.createElement(MapPin, { className: "w-5 h-5 text-primary-500" }), /* @__PURE__ */ React19.createElement("span", null, "123 Store Street, City, Country")))), /* @__PURE__ */ React19.createElement("div", null, /* @__PURE__ */ React19.createElement("h4", { className: "text-lg font-semibold text-white mb-4" }, "Shop"), /* @__PURE__ */ React19.createElement("ul", { className: "space-y-2" }, footerLinks.shop.map((link) => /* @__PURE__ */ React19.createElement("li", { key: link.href }, /* @__PURE__ */ React19.createElement(
|
|
10808
|
-
|
|
11361
|
+
Link8,
|
|
10809
11362
|
{
|
|
10810
11363
|
href: link.href,
|
|
10811
11364
|
className: "hover:text-primary-500 transition-colors"
|
|
10812
11365
|
},
|
|
10813
11366
|
link.label
|
|
10814
11367
|
))))), /* @__PURE__ */ React19.createElement("div", null, /* @__PURE__ */ React19.createElement("h4", { className: "text-lg font-semibold text-white mb-4" }, "Account"), /* @__PURE__ */ React19.createElement("ul", { className: "space-y-2" }, footerLinks.account.map((link) => /* @__PURE__ */ React19.createElement("li", { key: link.href }, /* @__PURE__ */ React19.createElement(
|
|
10815
|
-
|
|
11368
|
+
Link8,
|
|
10816
11369
|
{
|
|
10817
11370
|
href: link.href,
|
|
10818
11371
|
className: "hover:text-primary-500 transition-colors"
|
|
10819
11372
|
},
|
|
10820
11373
|
link.label
|
|
10821
11374
|
))))), /* @__PURE__ */ React19.createElement("div", null, /* @__PURE__ */ React19.createElement("h4", { className: "text-lg font-semibold text-white mb-4" }, "Support"), /* @__PURE__ */ React19.createElement("ul", { className: "space-y-2" }, footerLinks.support.map((link) => /* @__PURE__ */ React19.createElement("li", { key: link.href }, /* @__PURE__ */ React19.createElement(
|
|
10822
|
-
|
|
11375
|
+
Link8,
|
|
10823
11376
|
{
|
|
10824
11377
|
href: link.href,
|
|
10825
11378
|
className: "hover:text-primary-500 transition-colors"
|
|
@@ -10849,6 +11402,6 @@ function Footer() {
|
|
|
10849
11402
|
)))));
|
|
10850
11403
|
}
|
|
10851
11404
|
|
|
10852
|
-
export { AddressesScreen, AuthProvider, Badge, Button, CartItem, CartProvider, CartScreen, CheckoutScreen, CurrentOrdersScreen, EcommerceProvider, EmptyState, Footer, Header, Input, LoginScreen, Modal, OrderCard, OrderCardSkeleton, OrdersScreen, ProductCard, ProductCardSkeleton, ProductDetailScreen, ProfileScreen, RegisterScreen, ShopScreen, Skeleton, ThemeProvider, WishlistProvider, formatDate, formatPrice, generateColorShades, getApiConfiguration, getInitials, hexToRgb, initializeApiAdapter, truncate, useAddresses, useAuth, useCart, useCategories, useCurrentOrders, useOrder, useOrders, useProduct, useProducts, useTheme, useWishlist };
|
|
11405
|
+
export { AddressesScreen, AuthProvider, Badge, Button, CartItem, CartProvider, CartScreen, CategoriesScreen, CheckoutScreen, CurrentOrdersScreen, EcommerceProvider, EmptyState, Footer, Header, Input, LoginScreen, Modal, NewAddressPage as NewAddressScreen, OrderCard, OrderCardSkeleton, OrdersScreen, ProductCard, ProductCardSkeleton, ProductDetailScreen, ProfileScreen, RegisterScreen, SearchPage as SearchResultsScreen, ShopScreen, Skeleton, ThemeProvider, WishlistProvider, WishlistScreen, formatDate, formatPrice, generateColorShades, getApiConfiguration, getInitials, hexToRgb, initializeApiAdapter, truncate, useAddresses, useAuth, useCart, useCategories, useCurrentOrders, useOrder, useOrders, useProduct, useProducts, useTheme, useWishlist };
|
|
10853
11406
|
//# sourceMappingURL=index.mjs.map
|
|
10854
11407
|
//# sourceMappingURL=index.mjs.map
|