@burdenoff/microfe-adaptercloud 2026.614.1 → 2026.625.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/adaptercloud/components/EmptyState.js +17 -21
- package/dist/adaptercloud/components/EmptyState.js.map +1 -1
- package/dist/adaptercloud/components/InvestmentCard.js +30 -28
- package/dist/adaptercloud/components/InvestmentCard.js.map +1 -1
- package/dist/adaptercloud/components/MetricsCard.js +21 -15
- package/dist/adaptercloud/components/MetricsCard.js.map +1 -1
- package/dist/adaptercloud/components/PageLayout.js +38 -19
- package/dist/adaptercloud/components/PageLayout.js.map +1 -1
- package/dist/adaptercloud/components/RatingDisplay.js +3 -3
- package/dist/adaptercloud/components/RatingDisplay.js.map +1 -1
- package/dist/adaptercloud/components/StatusBadge.js +36 -16
- package/dist/adaptercloud/components/StatusBadge.js.map +1 -1
- package/dist/adaptercloud/pages/HomePage.js +286 -275
- package/dist/adaptercloud/pages/HomePage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +87 -87
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminDashboard.js +101 -101
- package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +48 -48
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +95 -95
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js +34 -34
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +40 -40
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/CartManagementPage.js +107 -107
- package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/UserManagementPage.js +98 -98
- package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +117 -117
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +33 -33
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +112 -109
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +115 -115
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +85 -85
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +106 -106
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +88 -88
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +94 -94
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/common/HelpSupportPage.js +142 -142
- package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js +67 -66
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +1 -1
- package/dist/adaptercloud/pages/common/SettingsPage.js +115 -115
- package/dist/adaptercloud/pages/common/SettingsPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +74 -73
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CartDetailPage.js +87 -86
- package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +66 -65
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CheckoutPage.js +80 -80
- package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js +88 -88
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +84 -84
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +92 -91
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/FavoritesPage.js +34 -33
- package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +44 -43
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +61 -60
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +58 -57
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/ReviewsPage.js +48 -47
- package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +46 -45
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +128 -128
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +88 -87
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +88 -88
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js +62 -62
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +39 -38
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +66 -66
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +153 -153
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +81 -80
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js +106 -106
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +73 -72
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +107 -107
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +71 -69
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/dist/adaptercloud/utils/cn.js +2 -2
- package/dist/node_modules/{.bun/clsx@2.1.1/node_modules/clsx → clsx}/dist/clsx.js +1 -1
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/{.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge → tailwind-merge}/dist/bundle-mjs.js +212 -170
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/package.json +3 -3
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +0 -1
- package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoritesPage.js","names":[],"sources":["../../../../src/adaptercloud/pages/customer/FavoritesPage.tsx"],"sourcesContent":["/**\n * Favorites Page\n * @module adaptercloud/pages/customer\n *\n * Favorite carts AND products with stats header, 4 filters\n * (search, type, category, sort), Order Again / View Menu per cart,\n * Add to Cart / View Cart + remove per product, Veg badges,\n * prep time, 3 mock favorite products, 2 mock favorite carts.\n */\n\nimport { useState, useCallback, useEffect } from 'react';\nimport {\n Heart,\n Star,\n MapPin,\n Clock,\n CheckCircle2,\n Search,\n ShoppingCart,\n Leaf,\n Utensils,\n RotateCcw,\n ListFilter,\n X,\n} from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { EmptyState } from '../../components/EmptyState';\nimport { useAdapterCloud } from '../../context/AdapterCloudContext';\nimport { useProviders, useOrders } from '../../hooks/useAdapterCloudApi';\nimport { mockCarts } from '../../mocks/data';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency, formatDate, formatDistance } from '../../utils/formatters';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ninterface FavoriteCart {\n id: string;\n name: string;\n description: string;\n category: string;\n image: string;\n rating: number;\n reviewCount: number;\n isOpen: boolean;\n isVerified: boolean;\n distance: number;\n estimatedTime: number;\n addedToFavorites: string;\n lastOrdered?: string;\n totalOrders: number;\n totalSpent: number;\n}\n\ninterface FavoriteProduct {\n id: string;\n name: string;\n description: string;\n price: number;\n category: string;\n image: string;\n cartId: string;\n cartName: string;\n isVegetarian: boolean;\n isVegan: boolean;\n preparationTime: number;\n rating: number;\n addedToFavorites: string;\n lastOrdered?: string;\n orderCount: number;\n}\n\ninterface FavoriteFilters {\n searchQuery: string;\n type: 'all' | 'carts' | 'products';\n category: string;\n sortBy: 'recent' | 'name' | 'rating' | 'orders';\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function FavoritesPage() {\n const { navigateTo, currentUser } = useAdapterCloud();\n const { data: providers = [], isLoading: isLoadingProviders } = useProviders();\n const { data: orders = [], isLoading: isLoadingOrders } = useOrders({\n customerId: currentUser?.id,\n });\n\n const favoriteCarts: FavoriteCart[] = providers.slice(0, 2).map((p) => ({\n id: p.id,\n name: p.name,\n description: 'Authentic services from AdapterCloud',\n category: p.category,\n image: p.image,\n rating: p.rating,\n reviewCount: p.totalRatings,\n isOpen: p.isOpen,\n isVerified: p.isVerified || false,\n distance: p.distance,\n estimatedTime: p.estimatedTime,\n addedToFavorites: new Date().toISOString(),\n totalOrders: orders.filter((o) => o.cartId === p.id).length,\n totalSpent: orders.filter((o) => o.cartId === p.id).reduce((acc, o) => acc + o.total, 0),\n }));\n\n const favoriteProducts: FavoriteProduct[] = [\n {\n id: 'prod-001',\n name: 'Masala Dosa',\n description: 'Crispy rice crepe with spiced potato filling',\n price: 120,\n category: 'South Indian',\n image: 'https://images.unsplash.com/photo-1630383249896-424e482df921?w=300',\n cartId: providers[0]?.id || 'FOOD-001',\n cartName: providers[0]?.name || 'Dosa Express',\n isVegetarian: true,\n isVegan: false,\n preparationTime: 15,\n rating: 4.7,\n addedToFavorites: '2024-02-20T12:30:00Z',\n orderCount: 8,\n },\n ];\n\n const [filters, setFilters] = useState<FavoriteFilters>({\n searchQuery: '',\n type: 'all',\n category: '',\n sortBy: 'recent',\n });\n\n const isLoading = isLoadingProviders || isLoadingOrders;\n\n // --- Derived data ---\n const getDisplayItems = useCallback(() => {\n let carts = [...favoriteCarts];\n let products = [...favoriteProducts];\n\n // Search\n if (filters.searchQuery) {\n const q = filters.searchQuery.toLowerCase();\n carts = carts.filter(\n (c) =>\n c.name.toLowerCase().includes(q) ||\n c.description.toLowerCase().includes(q) ||\n c.category.toLowerCase().includes(q)\n );\n products = products.filter(\n (p) =>\n p.name.toLowerCase().includes(q) ||\n p.description.toLowerCase().includes(q) ||\n p.category.toLowerCase().includes(q) ||\n p.cartName.toLowerCase().includes(q)\n );\n }\n\n // Category\n if (filters.category) {\n carts = carts.filter((c) => c.category === filters.category);\n products = products.filter((p) => p.category === filters.category);\n }\n\n // Sort\n switch (filters.sortBy) {\n case 'recent':\n carts.sort(\n (a, b) => new Date(b.addedToFavorites).getTime() - new Date(a.addedToFavorites).getTime()\n );\n products.sort(\n (a, b) => new Date(b.addedToFavorites).getTime() - new Date(a.addedToFavorites).getTime()\n );\n break;\n case 'name':\n carts.sort((a, b) => a.name.localeCompare(b.name));\n products.sort((a, b) => a.name.localeCompare(b.name));\n break;\n case 'rating':\n carts.sort((a, b) => b.rating - a.rating);\n products.sort((a, b) => b.rating - a.rating);\n break;\n case 'orders':\n carts.sort((a, b) => b.totalOrders - a.totalOrders);\n products.sort((a, b) => b.orderCount - a.orderCount);\n break;\n }\n\n // Type filter\n if (filters.type === 'carts') return { carts, products: [] };\n if (filters.type === 'products') return { carts: [], products };\n return { carts, products };\n }, [favoriteCarts, favoriteProducts, filters]);\n\n const { carts: displayCarts, products: displayProducts } = getDisplayItems();\n\n const handleRemoveCart = (id: string) => {\n // In real app, this would call an API\n console.log('Remove cart:', id);\n };\n\n const handleRemoveProduct = (id: string) => {\n // In real app, this would call an API\n console.log('Remove product:', id);\n };\n\n // Stats\n const totalSaved =\n favoriteCarts.reduce((s, c) => s + c.totalSpent, 0) +\n favoriteProducts.reduce((s, p) => s + p.price * p.orderCount, 0);\n\n if (isLoading) {\n return (\n <PageLayout title=\"My Favorites\">\n <div className=\"flex items-center justify-center py-20\">\n <div className=\"animate-spin rounded-full h-12 w-12 border-b-2 border-foreground\" />\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"My Favorites\"\n description={`${favoriteCarts.length} carts, ${favoriteProducts.length} products`}\n >\n {/* Stats Header */}\n <div className=\"flex flex-wrap items-center gap-4 text-sm text-muted-foreground mb-6\">\n <span className=\"flex items-center gap-1.5\">\n <ShoppingCart className=\"h-3.5 w-3.5\" />\n {favoriteCarts.length} carts\n </span>\n <span className=\"flex items-center gap-1.5\">\n <Utensils className=\"h-3.5 w-3.5\" />\n {favoriteProducts.length} products\n </span>\n <span className=\"flex items-center gap-1.5\">\n <Star className=\"h-3.5 w-3.5\" />\n Total saved: {formatCurrency(totalSaved, { minimumFractionDigits: 0 })}\n </span>\n </div>\n\n {/* Filters */}\n <div className=\"rounded-lg border border-border bg-card p-4 mb-6\">\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3\">\n {/* Search */}\n <div className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground\" />\n <input\n type=\"text\"\n placeholder=\"Search favorites...\"\n value={filters.searchQuery}\n onChange={(e) => setFilters((p) => ({ ...p, searchQuery: e.target.value }))}\n className=\"w-full rounded-lg border border-border bg-card py-2 pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n\n {/* Type */}\n <select\n value={filters.type}\n onChange={(e) =>\n setFilters((p) => ({ ...p, type: e.target.value as FavoriteFilters['type'] }))\n }\n className=\"w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n >\n <option value=\"all\">All Favorites</option>\n <option value=\"carts\">Favorite Carts</option>\n <option value=\"products\">Favorite Products</option>\n </select>\n\n {/* Category */}\n <select\n value={filters.category}\n onChange={(e) => setFilters((p) => ({ ...p, category: e.target.value }))}\n className=\"w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n >\n <option value=\"\">All Categories</option>\n <option value=\"Food & Beverage\">Food & Beverage</option>\n <option value=\"Street Food\">Street Food</option>\n <option value=\"South Indian\">South Indian</option>\n <option value=\"Beverages\">Beverages</option>\n </select>\n\n {/* Sort */}\n <select\n value={filters.sortBy}\n onChange={(e) =>\n setFilters((p) => ({ ...p, sortBy: e.target.value as FavoriteFilters['sortBy'] }))\n }\n className=\"w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n >\n <option value=\"recent\">Recently Added</option>\n <option value=\"name\">Name A-Z</option>\n <option value=\"rating\">Highest Rated</option>\n <option value=\"orders\">Most Ordered</option>\n </select>\n </div>\n </div>\n\n {/* Content */}\n {displayCarts.length === 0 && displayProducts.length === 0 ? (\n <EmptyState\n icon={<Heart className=\"h-12 w-12\" />}\n title=\"No favorites yet\"\n description=\"Browse carts and tap the heart icon to add them to your favorites.\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/carts')}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Discover Carts\n </button>\n }\n />\n ) : (\n <div className=\"space-y-8\">\n {/* Favorite Carts */}\n {displayCarts.length > 0 && (\n <section>\n <h3 className=\"text-base font-semibold text-foreground mb-4 flex items-center gap-2\">\n <ShoppingCart className=\"h-4 w-4 text-muted-foreground\" />\n Favorite Carts ({displayCarts.length})\n </h3>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4\">\n {displayCarts.map((cart) => (\n <div\n key={cart.id}\n className=\"rounded-lg border border-border bg-card shadow-sm overflow-hidden\"\n >\n {/* Image */}\n <div className=\"relative h-36 bg-muted\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"block h-full w-full\"\n >\n <img\n src={cart.image}\n alt={cart.name}\n className=\"h-full w-full object-cover\"\n />\n </button>\n <button\n type=\"button\"\n onClick={() => handleRemoveCart(cart.id)}\n title=\"Remove from favorites\"\n className=\"absolute top-2 right-2 flex h-8 w-8 items-center justify-center rounded-full bg-card/80 backdrop-blur-sm text-red-500 hover:bg-card transition-colors\"\n >\n <Heart className=\"h-4 w-4 fill-current\" />\n </button>\n <div className=\"absolute top-2 left-2\">\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium',\n cart.isOpen\n ? 'bg-green-500/20 text-green-600 dark:text-green-400'\n : 'bg-destructive/20 text-destructive'\n )}\n >\n {cart.isOpen ? 'Open' : 'Closed'}\n </span>\n </div>\n </div>\n\n {/* Details */}\n <div className=\"p-4\">\n <div className=\"flex items-start justify-between gap-2 mb-2\">\n <h4 className=\"text-sm font-semibold text-foreground truncate\">\n {cart.name}\n </h4>\n <div className=\"flex items-center gap-1 shrink-0\">\n <Star className=\"h-3.5 w-3.5 fill-yellow-400 text-yellow-400\" />\n <span className=\"text-xs font-medium text-foreground\">{cart.rating}</span>\n <span className=\"text-xs text-muted-foreground\">\n ({cart.reviewCount})\n </span>\n </div>\n </div>\n\n <p className=\"text-xs text-muted-foreground line-clamp-2 mb-3\">\n {cart.description}\n </p>\n\n <div className=\"space-y-1.5 text-xs text-muted-foreground\">\n <div className=\"flex justify-between\">\n <span>Added:</span>\n <span>\n {formatDate(cart.addedToFavorites, {\n hour: undefined,\n minute: undefined,\n hour12: undefined,\n })}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span>Total orders:</span>\n <span>{cart.totalOrders}</span>\n </div>\n <div className=\"flex justify-between\">\n <span>Total spent:</span>\n <span className=\"font-medium\">\n {formatCurrency(cart.totalSpent, { minimumFractionDigits: 0 })}\n </span>\n </div>\n {cart.lastOrdered && (\n <div className=\"flex justify-between\">\n <span>Last ordered:</span>\n <span>\n {formatDate(cart.lastOrdered, {\n hour: undefined,\n minute: undefined,\n hour12: undefined,\n })}\n </span>\n </div>\n )}\n </div>\n\n <div className=\"flex gap-2 mt-4\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"flex-1 flex items-center justify-center gap-1.5 rounded-lg bg-foreground px-3 py-2 text-xs font-medium text-background hover:opacity-90 transition-opacity\"\n >\n <RotateCcw className=\"h-3 w-3\" />\n Order Again\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"flex-1 rounded-lg border border-border px-3 py-2 text-xs font-medium text-foreground hover:bg-accent transition-colors\"\n >\n View Menu\n </button>\n </div>\n </div>\n </div>\n ))}\n </div>\n </section>\n )}\n\n {/* Favorite Products */}\n {displayProducts.length > 0 && (\n <section>\n <h3 className=\"text-base font-semibold text-foreground mb-4 flex items-center gap-2\">\n <Utensils className=\"h-4 w-4 text-muted-foreground\" />\n Favorite Products ({displayProducts.length})\n </h3>\n <div className=\"space-y-3\">\n {displayProducts.map((product) => (\n <div key={product.id} className=\"rounded-lg border border-border bg-card p-4\">\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-4\">\n {/* Image */}\n <img\n src={product.image}\n alt={product.name}\n className=\"w-20 h-20 rounded-lg object-cover shrink-0 mx-auto sm:mx-0\"\n />\n\n {/* Info */}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-start justify-between gap-2 mb-1\">\n <h4 className=\"text-sm font-semibold text-foreground\">{product.name}</h4>\n <div className=\"flex items-center gap-2 shrink-0\">\n <span className=\"text-base font-bold text-foreground\">\n {formatCurrency(product.price, { minimumFractionDigits: 0 })}\n </span>\n <button\n type=\"button\"\n onClick={() => handleRemoveProduct(product.id)}\n title=\"Remove from favorites\"\n className=\"rounded-md p-1 text-red-500 hover:bg-destructive/10 transition-colors\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n\n <p className=\"text-xs text-muted-foreground mb-2\">{product.description}</p>\n\n <div className=\"flex flex-wrap items-center gap-2 text-xs text-muted-foreground mb-2\">\n <span>\n From:{' '}\n <span className=\"font-medium text-foreground\">{product.cartName}</span>\n </span>\n <span>Ordered {product.orderCount} times</span>\n <span>\n Added:{' '}\n {formatDate(product.addedToFavorites, {\n hour: undefined,\n minute: undefined,\n hour12: undefined,\n })}\n </span>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-2\">\n {product.isVegetarian && (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400\">\n <Leaf className=\"h-3 w-3\" />\n Veg\n </span>\n )}\n {product.isVegan && (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400\">\n <Leaf className=\"h-3 w-3\" />\n Vegan\n </span>\n )}\n <span className=\"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {product.preparationTime} min\n </span>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex sm:flex-col gap-2 shrink-0\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${product.cartId}`)}\n className=\"flex-1 sm:flex-none rounded-lg bg-foreground px-4 py-2 text-xs font-medium text-background hover:opacity-90 transition-opacity whitespace-nowrap\"\n >\n Add to Cart\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${product.cartId}`)}\n className=\"flex-1 sm:flex-none rounded-lg border border-border px-4 py-2 text-xs font-medium text-foreground hover:bg-accent transition-colors whitespace-nowrap\"\n >\n View Cart\n </button>\n </div>\n </div>\n </div>\n ))}\n </div>\n </section>\n )}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;AAoFA,SAAgB,IAAgB;CAC9B,IAAM,EAAE,eAAY,mBAAgB,GAAiB,EAC/C,EAAE,MAAM,IAAY,EAAE,EAAE,WAAW,MAAuB,GAAc,EACxE,EAAE,MAAM,IAAS,EAAE,EAAE,WAAW,MAAoB,EAAU,EAClE,YAAY,GAAa,IAC1B,CAAC,EAEI,IAAgC,EAAU,MAAM,GAAG,EAAE,CAAC,KAAK,OAAO;EACtE,IAAI,EAAE;EACN,MAAM,EAAE;EACR,aAAa;EACb,UAAU,EAAE;EACZ,OAAO,EAAE;EACT,QAAQ,EAAE;EACV,aAAa,EAAE;EACf,QAAQ,EAAE;EACV,YAAY,E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AAK,WAAU;mBAAf,CACE,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAW,mBAAmB,EAAQ,SAAS;UAC9D,WAAU;oBACX;UAEQ,CAAA,EACT,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAW,mBAAmB,EAAQ,SAAS;UAC9D,WAAU;oBACX;UAEQ,CAAA,CACL;;QACF;;MACF,EApFI,EAAQ,GAoFZ,CACN;KACE,CAAA,CACE,EAAA,CAAA,CAER;;GAEG"}
|
|
1
|
+
{"version":3,"file":"FavoritesPage.js","names":[],"sources":["../../../../src/adaptercloud/pages/customer/FavoritesPage.tsx"],"sourcesContent":["/**\n * Favorites Page\n * @module adaptercloud/pages/customer\n *\n * Favorite carts AND products with stats header, 4 filters\n * (search, type, category, sort), Order Again / View Menu per cart,\n * Add to Cart / View Cart + remove per product, Veg badges,\n * prep time, 3 mock favorite products, 2 mock favorite carts.\n */\n\nimport { useState, useCallback, useEffect } from'react';\nimport {\n Heart,\n Star,\n MapPin,\n Clock,\n CheckCircle2,\n Search,\n ShoppingCart,\n Leaf,\n Utensils,\n RotateCcw,\n ListFilter,\n X,\n} from'lucide-react';\nimport { PageLayout } from'../../components/PageLayout';\nimport { EmptyState } from'../../components/EmptyState';\nimport { useAdapterCloud } from'../../context/AdapterCloudContext';\nimport { useProviders, useOrders } from'../../hooks/useAdapterCloudApi';\nimport { mockCarts } from'../../mocks/data';\nimport { cn } from'../../utils/cn';\nimport { formatCurrency, formatDate, formatDistance } from'../../utils/formatters';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ninterface FavoriteCart {\n id: string;\n name: string;\n description: string;\n category: string;\n image: string;\n rating: number;\n reviewCount: number;\n isOpen: boolean;\n isVerified: boolean;\n distance: number;\n estimatedTime: number;\n addedToFavorites: string;\n lastOrdered?: string;\n totalOrders: number;\n totalSpent: number;\n}\n\ninterface FavoriteProduct {\n id: string;\n name: string;\n description: string;\n price: number;\n category: string;\n image: string;\n cartId: string;\n cartName: string;\n isVegetarian: boolean;\n isVegan: boolean;\n preparationTime: number;\n rating: number;\n addedToFavorites: string;\n lastOrdered?: string;\n orderCount: number;\n}\n\ninterface FavoriteFilters {\n searchQuery: string;\n type: 'all' | 'carts' | 'products';\n category: string;\n sortBy: 'recent' | 'name' | 'rating' | 'orders';\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function FavoritesPage() {\n const { navigateTo, currentUser } = useAdapterCloud();\n const { data: providers = [], isLoading: isLoadingProviders } = useProviders();\n const { data: orders = [], isLoading: isLoadingOrders } = useOrders({\n customerId: currentUser?.id,\n });\n\n const favoriteCarts: FavoriteCart[] = providers.slice(0, 2).map((p) => ({\n id: p.id,\n name: p.name,\n description: 'Authentic services from AdapterCloud',\n category: p.category,\n image: p.image,\n rating: p.rating,\n reviewCount: p.totalRatings,\n isOpen: p.isOpen,\n isVerified: p.isVerified || false,\n distance: p.distance,\n estimatedTime: p.estimatedTime,\n addedToFavorites: new Date().toISOString(),\n totalOrders: orders.filter((o) => o.cartId === p.id).length,\n totalSpent: orders.filter((o) => o.cartId === p.id).reduce((acc, o) => acc + o.total, 0),\n }));\n\n const favoriteProducts: FavoriteProduct[] = [\n {\n id: 'prod-001',\n name: 'Masala Dosa',\n description: 'Crispy rice crepe with spiced potato filling',\n price: 120,\n category: 'South Indian',\n image: 'https://images.unsplash.com/photo-1630383249896-424e482df921?w=300',\n cartId: providers[0]?.id || 'FOOD-001',\n cartName: providers[0]?.name || 'Dosa Express',\n isVegetarian: true,\n isVegan: false,\n preparationTime: 15,\n rating: 4.7,\n addedToFavorites: '2024-02-20T12:30:00Z',\n orderCount: 8,\n },\n ];\n\n const [filters, setFilters] = useState<FavoriteFilters>({\n searchQuery: '',\n type: 'all',\n category: '',\n sortBy: 'recent',\n });\n\n const isLoading = isLoadingProviders || isLoadingOrders;\n\n // --- Derived data ---\n const getDisplayItems = useCallback(() => {\n let carts = [...favoriteCarts];\n let products = [...favoriteProducts];\n\n // Search\n if (filters.searchQuery) {\n const q = filters.searchQuery.toLowerCase();\n carts = carts.filter(\n (c) =>\n c.name.toLowerCase().includes(q) ||\n c.description.toLowerCase().includes(q) ||\n c.category.toLowerCase().includes(q)\n );\n products = products.filter(\n (p) =>\n p.name.toLowerCase().includes(q) ||\n p.description.toLowerCase().includes(q) ||\n p.category.toLowerCase().includes(q) ||\n p.cartName.toLowerCase().includes(q)\n );\n }\n\n // Category\n if (filters.category) {\n carts = carts.filter((c) => c.category === filters.category);\n products = products.filter((p) => p.category === filters.category);\n }\n\n // Sort\n switch (filters.sortBy) {\n case'recent':\n carts.sort(\n (a, b) => new Date(b.addedToFavorites).getTime() - new Date(a.addedToFavorites).getTime()\n );\n products.sort(\n (a, b) => new Date(b.addedToFavorites).getTime() - new Date(a.addedToFavorites).getTime()\n );\n break;\n case'name':\n carts.sort((a, b) => a.name.localeCompare(b.name));\n products.sort((a, b) => a.name.localeCompare(b.name));\n break;\n case'rating':\n carts.sort((a, b) => b.rating - a.rating);\n products.sort((a, b) => b.rating - a.rating);\n break;\n case'orders':\n carts.sort((a, b) => b.totalOrders - a.totalOrders);\n products.sort((a, b) => b.orderCount - a.orderCount);\n break;\n }\n\n // Type filter\n if (filters.type === 'carts') return { carts, products: [] };\n if (filters.type === 'products') return { carts: [], products };\n return { carts, products };\n }, [favoriteCarts, favoriteProducts, filters]);\n\n const { carts: displayCarts, products: displayProducts } = getDisplayItems();\n\n const handleRemoveCart = (id: string) => {\n // In real app, this would call an API\n console.log('Remove cart:', id);\n };\n\n const handleRemoveProduct = (id: string) => {\n // In real app, this would call an API\n console.log('Remove product:', id);\n };\n\n // Stats\n const totalSaved =\n favoriteCarts.reduce((s, c) => s + c.totalSpent, 0) +\n favoriteProducts.reduce((s, p) => s + p.price * p.orderCount, 0);\n\n if (isLoading) {\n return (\n <PageLayout title=\"My Favorites\">\n <div className=\"flex items-center justify-center py-20\">\n <div className=\"animate-spin rounded-full h-12 w-12 border-b-2 border-foreground\" />\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"My Favorites\"\n description={`${favoriteCarts.length} carts, ${favoriteProducts.length} products`}\n >\n {/* Stats Header */}\n <div className=\"flex flex-wrap items-center gap-4 text-sm text-text-secondary mb-6\">\n <span className=\"flex items-center gap-1.5\">\n <ShoppingCart className=\"h-3.5 w-3.5\" />\n {favoriteCarts.length} carts\n </span>\n <span className=\"flex items-center gap-1.5\">\n <Utensils className=\"h-3.5 w-3.5\" />\n {favoriteProducts.length} products\n </span>\n <span className=\"flex items-center gap-1.5\">\n <Star className=\"h-3.5 w-3.5\" />\n Total saved: {formatCurrency(totalSaved, { minimumFractionDigits: 0 })}\n </span>\n </div>\n\n {/* Filters */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4 mb-6 bg-gloss-card shadow-pop\">\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3\">\n {/* Search */}\n <div className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary\" />\n <input\n type=\"text\"\n placeholder=\"Search favorites...\"\n value={filters.searchQuery}\n onChange={(e) => setFilters((p) => ({ ...p, searchQuery: e.target.value }))}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface py-2 pl-9 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n\n {/* Type */}\n <select\n value={filters.type}\n onChange={(e) =>\n setFilters((p) => ({ ...p, type: e.target.value as FavoriteFilters['type'] }))\n }\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option value=\"all\">All Favorites</option>\n <option value=\"carts\">Favorite Carts</option>\n <option value=\"products\">Favorite Products</option>\n </select>\n\n {/* Category */}\n <select\n value={filters.category}\n onChange={(e) => setFilters((p) => ({ ...p, category: e.target.value }))}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option value=\"\">All Categories</option>\n <option value=\"Food & Beverage\">Food & Beverage</option>\n <option value=\"Street Food\">Street Food</option>\n <option value=\"South Indian\">South Indian</option>\n <option value=\"Beverages\">Beverages</option>\n </select>\n\n {/* Sort */}\n <select\n value={filters.sortBy}\n onChange={(e) =>\n setFilters((p) => ({ ...p, sortBy: e.target.value as FavoriteFilters['sortBy'] }))\n }\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n <option value=\"recent\">Recently Added</option>\n <option value=\"name\">Name A-Z</option>\n <option value=\"rating\">Highest Rated</option>\n <option value=\"orders\">Most Ordered</option>\n </select>\n </div>\n </div>\n\n {/* Content */}\n {displayCarts.length === 0 && displayProducts.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n icon={<Heart className=\"h-12 w-12\" />}\n title=\"No favorites yet\"\n description=\"Browse carts and tap the heart icon to add them to your favorites.\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/carts')}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Discover Carts\n </button>\n }\n />\n ) : (\n <div className=\"space-y-8\">\n {/* Favorite Carts */}\n {displayCarts.length > 0 && (\n <section>\n <h3 className=\"text-base font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <ShoppingCart className=\"h-4 w-4 text-text-secondary\" />\n Favorite Carts ({displayCarts.length})\n </h3>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4\">\n {displayCarts.map((cart) => (\n <div\n key={cart.id}\n className=\"rounded-lg border border-border-subtle bg-bg-surface shadow-sm overflow-hidden\"\n >\n {/* Image */}\n <div className=\"relative h-36 bg-bg-sunken\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"block h-full w-full\"\n >\n <img\n src={cart.image}\n alt={cart.name}\n className=\"h-full w-full object-cover\"\n />\n </button>\n <button\n type=\"button\"\n onClick={() => handleRemoveCart(cart.id)}\n title=\"Remove from favorites\"\n className=\"absolute top-2 right-2 flex h-8 w-8 items-center justify-center rounded-full bg-bg-surface/80 backdrop-blur-sm text-status-error-text hover:bg-bg-surface transition-colors\"\n >\n <Heart className=\"h-4 w-4 fill-current\" />\n </button>\n <div className=\"absolute top-2 left-2\">\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium',\n cart.isOpen\n ? 'bg-status-success-bg-subtle/20 text-status-success-text'\n : 'bg-status-error-bg/20 text-status-error-text'\n )}\n >\n {cart.isOpen ? 'Open' : 'Closed'}\n </span>\n </div>\n </div>\n\n {/* Details */}\n <div className=\"p-4\">\n <div className=\"flex items-start justify-between gap-2 mb-2\">\n <h4 className=\"text-sm font-semibold text-text-primary truncate\">\n {cart.name}\n </h4>\n <div className=\"flex items-center gap-1 shrink-0\">\n <Star className=\"h-3.5 w-3.5 fill-status-warning-text text-status-warning-text\" />\n <span className=\"text-xs font-medium text-text-primary\">{cart.rating}</span>\n <span className=\"text-xs text-text-secondary\">\n ({cart.reviewCount})\n </span>\n </div>\n </div>\n\n <p className=\"text-xs text-text-secondary line-clamp-2 mb-3\">\n {cart.description}\n </p>\n\n <div className=\"space-y-1.5 text-xs text-text-secondary\">\n <div className=\"flex justify-between\">\n <span>Added:</span>\n <span>\n {formatDate(cart.addedToFavorites, {\n hour: undefined,\n minute: undefined,\n hour12: undefined,\n })}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span>Total orders:</span>\n <span>{cart.totalOrders}</span>\n </div>\n <div className=\"flex justify-between\">\n <span>Total spent:</span>\n <span className=\"font-medium\">\n {formatCurrency(cart.totalSpent, { minimumFractionDigits: 0 })}\n </span>\n </div>\n {cart.lastOrdered && (\n <div className=\"flex justify-between\">\n <span>Last ordered:</span>\n <span>\n {formatDate(cart.lastOrdered, {\n hour: undefined,\n minute: undefined,\n hour12: undefined,\n })}\n </span>\n </div>\n )}\n </div>\n\n <div className=\"flex gap-2 mt-4\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"flex-1 flex items-center justify-center gap-1.5 rounded-lg bg-foreground px-3 py-2 text-xs font-medium text-background hover:opacity-90 transition-opacity\"\n >\n <RotateCcw className=\"h-3 w-3\" />\n Order Again\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${cart.id}`)}\n className=\"flex-1 rounded-lg border border-border-subtle px-3 py-2 text-xs font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n View Menu\n </button>\n </div>\n </div>\n </div>\n ))}\n </div>\n </section>\n )}\n\n {/* Favorite Products */}\n {displayProducts.length > 0 && (\n <section>\n <h3 className=\"text-base font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <Utensils className=\"h-4 w-4 text-text-secondary\" />\n Favorite Products ({displayProducts.length})\n </h3>\n <div className=\"space-y-3\">\n {displayProducts.map((product) => (\n <div key={product.id} className=\"rounded-lg border border-border-seam bg-bg-surface p-4 bg-gloss-card shadow-pop\">\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-4\">\n {/* Image */}\n <img\n src={product.image}\n alt={product.name}\n className=\"w-20 h-20 rounded-lg object-cover shrink-0 mx-auto sm:mx-0\"\n />\n\n {/* Info */}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-start justify-between gap-2 mb-1\">\n <h4 className=\"text-sm font-semibold text-text-primary\">{product.name}</h4>\n <div className=\"flex items-center gap-2 shrink-0\">\n <span className=\"text-base font-bold text-text-primary\">\n {formatCurrency(product.price, { minimumFractionDigits: 0 })}\n </span>\n <button\n type=\"button\"\n onClick={() => handleRemoveProduct(product.id)}\n title=\"Remove from favorites\"\n className=\"rounded-md p-1 text-status-error-text hover:bg-status-error-bg/10 transition-colors\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n\n <p className=\"text-xs text-text-secondary mb-2\">{product.description}</p>\n\n <div className=\"flex flex-wrap items-center gap-2 text-xs text-text-secondary mb-2\">\n <span>\n From:{' '}\n <span className=\"font-medium text-text-primary\">{product.cartName}</span>\n </span>\n <span>Ordered {product.orderCount} times</span>\n <span>\n Added:{' '}\n {formatDate(product.addedToFavorites, {\n hour: undefined,\n minute: undefined,\n hour12: undefined,\n })}\n </span>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-2\">\n {product.isVegetarian && (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle/10 px-2 py-0.5 text-[10px] font-medium text-status-success-text\">\n <Leaf className=\"h-3 w-3\" />\n Veg\n </span>\n )}\n {product.isVegan && (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle/10 px-2 py-0.5 text-[10px] font-medium text-status-success-text\">\n <Leaf className=\"h-3 w-3\" />\n Vegan\n </span>\n )}\n <span className=\"inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-[10px] font-medium text-text-secondary\">\n <Clock className=\"h-3 w-3\" />\n {product.preparationTime} min\n </span>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex sm:flex-col gap-2 shrink-0\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${product.cartId}`)}\n className=\"flex-1 sm:flex-none rounded-lg bg-foreground px-4 py-2 text-xs font-medium text-background hover:opacity-90 transition-opacity whitespace-nowrap\"\n >\n Add to Cart\n </button>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/carts/${product.cartId}`)}\n className=\"flex-1 sm:flex-none rounded-lg border border-border-subtle px-4 py-2 text-xs font-medium text-text-primary hover:bg-accent transition-colors whitespace-nowrap\"\n >\n View Cart\n </button>\n </div>\n </div>\n </div>\n ))}\n </div>\n </section>\n )}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;AAoFA,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AA,CAAA;YACH;;UAEN,kBAAC,OAAD;WAAK,WAAU;qBAAf;YACG,EAAQ,gBACP,kBAAC,QAAD;aAAM,WAAU;uBAAhB,CACE,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA,EAAA,MAEvB;;YAER,EAAQ,WACP,kBAAC,QAAD;aAAM,WAAU;uBAAhB,CACE,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA,EAAA,QAEvB;;YAET,kBAAC,QAAD;aAAM,WAAU;uBAAhB;cACE,kBAAC,GAAD,EAAO,WAAU,WAAY,CAAA;cAC5B,EAAQ;cAAgB;cACpB;;YACH;;UACF;;QAGN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAW,mBAAmB,EAAQ,SAAS;UAC9D,WAAU;oBACX;UAEQ,CAAA,EACT,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAW,mBAAmB,EAAQ,SAAS;UAC9D,WAAU;oBACX;UAEQ,CAAA,CACL;;QACF;;MACF,EApFI,EAAQ,GAoFZ,CACN;KACE,CAAA,CACE,EAAA,CAAA,CAER;;GAEG"}
|
|
@@ -150,7 +150,7 @@ function M() {
|
|
|
150
150
|
children: /* @__PURE__ */ D("div", {
|
|
151
151
|
className: "flex h-[60vh] flex-col items-center justify-center gap-4",
|
|
152
152
|
children: [
|
|
153
|
-
/* @__PURE__ */ E(u, { className: "h-12 w-12 text-
|
|
153
|
+
/* @__PURE__ */ E(u, { className: "h-12 w-12 text-status-error-text" }),
|
|
154
154
|
/* @__PURE__ */ E("h2", {
|
|
155
155
|
className: "text-xl font-semibold",
|
|
156
156
|
children: "Error loading your orders"
|
|
@@ -158,7 +158,7 @@ function M() {
|
|
|
158
158
|
/* @__PURE__ */ E("button", {
|
|
159
159
|
type: "button",
|
|
160
160
|
onClick: () => window.location.reload(),
|
|
161
|
-
className: "rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-
|
|
161
|
+
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text",
|
|
162
162
|
children: "Retry"
|
|
163
163
|
})
|
|
164
164
|
]
|
|
@@ -171,91 +171,91 @@ function M() {
|
|
|
171
171
|
className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3 mb-6",
|
|
172
172
|
children: [
|
|
173
173
|
/* @__PURE__ */ D("div", {
|
|
174
|
-
className: "rounded-lg border border-border bg-
|
|
174
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-3.5",
|
|
175
175
|
children: [/* @__PURE__ */ D("div", {
|
|
176
176
|
className: "flex items-center gap-2 mb-1",
|
|
177
|
-
children: [/* @__PURE__ */ E(v, { className: "h-3.5 w-3.5 text-
|
|
178
|
-
className: "text-xs text-
|
|
177
|
+
children: [/* @__PURE__ */ E(v, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ E("p", {
|
|
178
|
+
className: "text-xs text-text-secondary",
|
|
179
179
|
children: "Total Orders"
|
|
180
180
|
})]
|
|
181
181
|
}), /* @__PURE__ */ E("p", {
|
|
182
|
-
className: "text-xl font-bold text-
|
|
182
|
+
className: "text-xl font-bold text-text-primary",
|
|
183
183
|
children: V.totalOrders
|
|
184
184
|
})]
|
|
185
185
|
}),
|
|
186
186
|
/* @__PURE__ */ D("div", {
|
|
187
|
-
className: "rounded-lg border border-border bg-
|
|
187
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-3.5",
|
|
188
188
|
children: [/* @__PURE__ */ D("div", {
|
|
189
189
|
className: "flex items-center gap-2 mb-1",
|
|
190
|
-
children: [/* @__PURE__ */ E(g, { className: "h-3.5 w-3.5 text-
|
|
191
|
-
className: "text-xs text-
|
|
190
|
+
children: [/* @__PURE__ */ E(g, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ E("p", {
|
|
191
|
+
className: "text-xs text-text-secondary",
|
|
192
192
|
children: "Total Spent"
|
|
193
193
|
})]
|
|
194
194
|
}), /* @__PURE__ */ E("p", {
|
|
195
|
-
className: "text-xl font-bold text-
|
|
195
|
+
className: "text-xl font-bold text-text-primary",
|
|
196
196
|
children: a(V.totalSpent, { minimumFractionDigits: 0 })
|
|
197
197
|
})]
|
|
198
198
|
}),
|
|
199
199
|
/* @__PURE__ */ D("div", {
|
|
200
|
-
className: "rounded-lg border border-border bg-
|
|
200
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-3.5",
|
|
201
201
|
children: [/* @__PURE__ */ D("div", {
|
|
202
202
|
className: "flex items-center gap-2 mb-1",
|
|
203
|
-
children: [/* @__PURE__ */ E(C, { className: "h-3.5 w-3.5 text-
|
|
204
|
-
className: "text-xs text-
|
|
203
|
+
children: [/* @__PURE__ */ E(C, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ E("p", {
|
|
204
|
+
className: "text-xs text-text-secondary",
|
|
205
205
|
children: "Average Order"
|
|
206
206
|
})]
|
|
207
207
|
}), /* @__PURE__ */ E("p", {
|
|
208
|
-
className: "text-xl font-bold text-
|
|
208
|
+
className: "text-xl font-bold text-text-primary",
|
|
209
209
|
children: a(V.averageOrderValue, { minimumFractionDigits: 0 })
|
|
210
210
|
})]
|
|
211
211
|
}),
|
|
212
212
|
/* @__PURE__ */ D("div", {
|
|
213
|
-
className: "rounded-lg border border-border bg-
|
|
213
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-3.5",
|
|
214
214
|
children: [/* @__PURE__ */ D("div", {
|
|
215
215
|
className: "flex items-center gap-2 mb-1",
|
|
216
|
-
children: [/* @__PURE__ */ E(p, { className: "h-3.5 w-3.5 text-
|
|
217
|
-
className: "text-xs text-
|
|
216
|
+
children: [/* @__PURE__ */ E(p, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ E("p", {
|
|
217
|
+
className: "text-xs text-text-secondary",
|
|
218
218
|
children: "Recent Orders"
|
|
219
219
|
})]
|
|
220
220
|
}), /* @__PURE__ */ E("p", {
|
|
221
|
-
className: "text-xl font-bold text-
|
|
221
|
+
className: "text-xl font-bold text-text-primary",
|
|
222
222
|
children: V.recentOrdersCount
|
|
223
223
|
})]
|
|
224
224
|
}),
|
|
225
225
|
/* @__PURE__ */ D("div", {
|
|
226
|
-
className: "rounded-lg border border-border bg-
|
|
226
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-3.5 col-span-2 md:col-span-1",
|
|
227
227
|
children: [/* @__PURE__ */ D("div", {
|
|
228
228
|
className: "flex items-center gap-2 mb-1",
|
|
229
|
-
children: [/* @__PURE__ */ E(h, { className: "h-3.5 w-3.5 text-
|
|
230
|
-
className: "text-xs text-
|
|
229
|
+
children: [/* @__PURE__ */ E(h, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ E("p", {
|
|
230
|
+
className: "text-xs text-text-secondary",
|
|
231
231
|
children: "Favorite Cart"
|
|
232
232
|
})]
|
|
233
233
|
}), /* @__PURE__ */ E("p", {
|
|
234
|
-
className: "text-sm font-bold text-
|
|
234
|
+
className: "text-sm font-bold text-text-primary truncate",
|
|
235
235
|
children: V.favoriteCart
|
|
236
236
|
})]
|
|
237
237
|
})
|
|
238
238
|
]
|
|
239
239
|
}),
|
|
240
240
|
/* @__PURE__ */ E("div", {
|
|
241
|
-
className: "rounded-lg border border-border bg-
|
|
241
|
+
className: "rounded-lg border border-border-seam bg-bg-surface p-4 mb-6 bg-gloss-card shadow-pop",
|
|
242
242
|
children: /* @__PURE__ */ D("div", {
|
|
243
243
|
className: "grid grid-cols-1 md:grid-cols-4 gap-3",
|
|
244
244
|
children: [
|
|
245
245
|
/* @__PURE__ */ D("div", {
|
|
246
246
|
className: "relative",
|
|
247
|
-
children: [/* @__PURE__ */ E(b, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-
|
|
247
|
+
children: [/* @__PURE__ */ E(b, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary" }), /* @__PURE__ */ E("input", {
|
|
248
248
|
type: "text",
|
|
249
249
|
placeholder: "Search orders...",
|
|
250
250
|
value: I.searchQuery,
|
|
251
251
|
onChange: (e) => G("searchQuery", e.target.value),
|
|
252
|
-
className: "w-full rounded-lg border border-border bg-
|
|
252
|
+
className: "w-full rounded-lg border border-border-subtle bg-bg-surface pl-9 pr-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
253
253
|
})]
|
|
254
254
|
}),
|
|
255
255
|
/* @__PURE__ */ E("select", {
|
|
256
256
|
value: I.status,
|
|
257
257
|
onChange: (e) => G("status", e.target.value),
|
|
258
|
-
className: "w-full rounded-lg border border-border bg-
|
|
258
|
+
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
259
259
|
children: k.map((e) => /* @__PURE__ */ E("option", {
|
|
260
260
|
value: e.value,
|
|
261
261
|
children: e.label
|
|
@@ -264,7 +264,7 @@ function M() {
|
|
|
264
264
|
/* @__PURE__ */ E("select", {
|
|
265
265
|
value: I.dateRange,
|
|
266
266
|
onChange: (e) => G("dateRange", e.target.value),
|
|
267
|
-
className: "w-full rounded-lg border border-border bg-
|
|
267
|
+
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
268
268
|
children: A.map((e) => /* @__PURE__ */ E("option", {
|
|
269
269
|
value: e.value,
|
|
270
270
|
children: e.label
|
|
@@ -273,7 +273,7 @@ function M() {
|
|
|
273
273
|
/* @__PURE__ */ E("select", {
|
|
274
274
|
value: I.sortBy,
|
|
275
275
|
onChange: (e) => G("sortBy", e.target.value),
|
|
276
|
-
className: "w-full rounded-lg border border-border bg-
|
|
276
|
+
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
277
277
|
children: j.map((e) => /* @__PURE__ */ E("option", {
|
|
278
278
|
value: e.value,
|
|
279
279
|
children: e.label
|
|
@@ -285,10 +285,11 @@ function M() {
|
|
|
285
285
|
z ? /* @__PURE__ */ D("div", {
|
|
286
286
|
className: "flex flex-col items-center justify-center py-12 text-center",
|
|
287
287
|
children: [/* @__PURE__ */ E("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-foreground mx-auto mb-4" }), /* @__PURE__ */ E("p", {
|
|
288
|
-
className: "text-sm text-
|
|
288
|
+
className: "text-sm text-text-secondary",
|
|
289
289
|
children: "Loading orders..."
|
|
290
290
|
})]
|
|
291
291
|
}) : U.length === 0 ? /* @__PURE__ */ E(r, {
|
|
292
|
+
illustration: "empty-data",
|
|
292
293
|
icon: /* @__PURE__ */ E(x, { className: "h-12 w-12" }),
|
|
293
294
|
title: "No orders found",
|
|
294
295
|
description: I.searchQuery || I.status ? "Try adjusting your filters" : "You haven't placed any orders yet",
|
|
@@ -301,7 +302,7 @@ function M() {
|
|
|
301
302
|
}) : /* @__PURE__ */ E("div", {
|
|
302
303
|
className: "space-y-4",
|
|
303
304
|
children: U.map((e) => /* @__PURE__ */ E("div", {
|
|
304
|
-
className: "rounded-lg border border-border bg-
|
|
305
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface hover:shadow-md transition-shadow",
|
|
305
306
|
children: /* @__PURE__ */ D("div", {
|
|
306
307
|
className: "p-4 md:p-5",
|
|
307
308
|
children: [
|
|
@@ -312,11 +313,11 @@ function M() {
|
|
|
312
313
|
children: [/* @__PURE__ */ D("div", {
|
|
313
314
|
className: "flex flex-col sm:flex-row sm:items-center gap-2",
|
|
314
315
|
children: [/* @__PURE__ */ E("h3", {
|
|
315
|
-
className: "text-base font-semibold text-
|
|
316
|
+
className: "text-base font-semibold text-text-primary",
|
|
316
317
|
children: e.cartName
|
|
317
318
|
}), /* @__PURE__ */ E(n, { status: e.status })]
|
|
318
319
|
}), /* @__PURE__ */ D("p", {
|
|
319
|
-
className: "text-xs text-
|
|
320
|
+
className: "text-xs text-text-secondary mt-1",
|
|
320
321
|
children: [
|
|
321
322
|
"Order #",
|
|
322
323
|
e.id,
|
|
@@ -327,14 +328,14 @@ function M() {
|
|
|
327
328
|
}), /* @__PURE__ */ D("div", {
|
|
328
329
|
className: "flex flex-col sm:flex-row sm:items-center gap-2",
|
|
329
330
|
children: [/* @__PURE__ */ E("p", {
|
|
330
|
-
className: "text-lg font-bold text-
|
|
331
|
+
className: "text-lg font-bold text-text-primary",
|
|
331
332
|
children: a(e.total, { minimumFractionDigits: 0 })
|
|
332
333
|
}), /* @__PURE__ */ D("div", {
|
|
333
334
|
className: "flex gap-2",
|
|
334
335
|
children: [/* @__PURE__ */ D("button", {
|
|
335
336
|
type: "button",
|
|
336
337
|
onClick: () => M(`/customer/orders/${e.id}`),
|
|
337
|
-
className: "flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-
|
|
338
|
+
className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
|
|
338
339
|
children: [/* @__PURE__ */ E(m, { className: "h-3 w-3" }), "Track Order"]
|
|
339
340
|
}), e.status === "delivered" && /* @__PURE__ */ D("button", {
|
|
340
341
|
type: "button",
|
|
@@ -346,11 +347,11 @@ function M() {
|
|
|
346
347
|
})]
|
|
347
348
|
}),
|
|
348
349
|
/* @__PURE__ */ E("div", {
|
|
349
|
-
className: "border-t border-border pt-3",
|
|
350
|
+
className: "border-t border-border-subtle pt-3",
|
|
350
351
|
children: /* @__PURE__ */ D("div", {
|
|
351
352
|
className: "flex flex-wrap gap-1",
|
|
352
353
|
children: [e.items.slice(0, 3).map((t, n) => /* @__PURE__ */ D("span", {
|
|
353
|
-
className: "text-xs text-
|
|
354
|
+
className: "text-xs text-text-secondary",
|
|
354
355
|
children: [
|
|
355
356
|
t.name,
|
|
356
357
|
" (",
|
|
@@ -359,7 +360,7 @@ function M() {
|
|
|
359
360
|
n < Math.min(2, e.items.length - 1) && ", "
|
|
360
361
|
]
|
|
361
362
|
}, n)), e.items.length > 3 && /* @__PURE__ */ D("span", {
|
|
362
|
-
className: "text-xs text-
|
|
363
|
+
className: "text-xs text-text-secondary",
|
|
363
364
|
children: [
|
|
364
365
|
"+",
|
|
365
366
|
e.items.length - 3,
|
|
@@ -372,11 +373,11 @@ function M() {
|
|
|
372
373
|
className: "mt-3",
|
|
373
374
|
children: [
|
|
374
375
|
e.status === "delivered" && /* @__PURE__ */ D("div", {
|
|
375
|
-
className: "flex items-center gap-1.5 text-xs text-
|
|
376
|
+
className: "flex items-center gap-1.5 text-xs text-status-success-text",
|
|
376
377
|
children: [/* @__PURE__ */ E(d, { className: "h-3 w-3" }), /* @__PURE__ */ E("span", { children: "Order delivered successfully" })]
|
|
377
378
|
}),
|
|
378
379
|
e.status === "cancelled" && /* @__PURE__ */ D("div", {
|
|
379
|
-
className: "flex items-center gap-1.5 text-xs text-
|
|
380
|
+
className: "flex items-center gap-1.5 text-xs text-status-error-text",
|
|
380
381
|
children: [/* @__PURE__ */ E(T, { className: "h-3 w-3" }), /* @__PURE__ */ D("span", { children: ["Cancelled", e.cancellationReason && ` - ${e.cancellationReason}`] })]
|
|
381
382
|
}),
|
|
382
383
|
[
|
|
@@ -386,7 +387,7 @@ function M() {
|
|
|
386
387
|
"ready",
|
|
387
388
|
"out_for_delivery"
|
|
388
389
|
].includes(e.status) && /* @__PURE__ */ D("div", {
|
|
389
|
-
className: "flex items-center gap-1.5 text-xs text-
|
|
390
|
+
className: "flex items-center gap-1.5 text-xs text-accent-blue",
|
|
390
391
|
children: [/* @__PURE__ */ E(w, { className: "h-3 w-3" }), /* @__PURE__ */ D("span", { children: [
|
|
391
392
|
"Estimated delivery by",
|
|
392
393
|
" ",
|
|
@@ -400,7 +401,7 @@ function M() {
|
|
|
400
401
|
children: e.rating ? /* @__PURE__ */ D("div", {
|
|
401
402
|
className: "flex flex-col sm:flex-row sm:items-center gap-2",
|
|
402
403
|
children: [/* @__PURE__ */ E(s, { value: e.rating }), e.review && /* @__PURE__ */ D("p", {
|
|
403
|
-
className: "text-xs text-
|
|
404
|
+
className: "text-xs text-text-secondary italic",
|
|
404
405
|
children: [
|
|
405
406
|
"“",
|
|
406
407
|
e.review,
|
|
@@ -410,7 +411,7 @@ function M() {
|
|
|
410
411
|
}) : /* @__PURE__ */ D("button", {
|
|
411
412
|
type: "button",
|
|
412
413
|
onClick: () => M(`/customer/orders/${e.id}/rate`),
|
|
413
|
-
className: "flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-
|
|
414
|
+
className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
|
|
414
415
|
children: [/* @__PURE__ */ E(S, { className: "h-3 w-3" }), "Rate Order"]
|
|
415
416
|
})
|
|
416
417
|
})
|
|
@@ -425,7 +426,7 @@ function M() {
|
|
|
425
426
|
onClick: () => {
|
|
426
427
|
F((e) => e + O);
|
|
427
428
|
},
|
|
428
|
-
className: "inline-flex items-center gap-2 rounded-lg border border-border px-6 py-2.5 text-sm font-medium text-
|
|
429
|
+
className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-6 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
429
430
|
children: [/* @__PURE__ */ E(f, { className: "h-4 w-4" }), "Load More Orders"]
|
|
430
431
|
})
|
|
431
432
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderHistoryPage.js","names":[],"sources":["../../../../src/adaptercloud/pages/customer/OrderHistoryPage.tsx"],"sourcesContent":["/**\n * Order History Page\n * @module adaptercloud/pages/customer\n *\n * Full list of customer orders with stats summary, search, status/date/sort\n * filters, rating display, reorder, cancellation reason, and Load More pagination.\n */\n\nimport { useState, useMemo, useCallback, useEffect } from 'react';\nimport {\n ShoppingBag,\n Search,\n Star,\n RotateCcw,\n Eye,\n ChevronDown,\n Package,\n IndianRupee,\n TrendingUp,\n Clock,\n Heart,\n CheckCircle2,\n XCircle,\n Truck,\n Loader2,\n AlertCircle,\n} from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { RatingDisplay } from '../../components/RatingDisplay';\nimport { useAdapterCloud } from '../../context/AdapterCloudContext';\nimport { useOrders } from '../../hooks/useAdapterCloudApi';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency, formatDate } from '../../utils/formatters';\nimport type { OrderStatus, MockOrder } from '../../types';\n\ninterface OrderFilters {\n status: string;\n dateRange: string;\n searchQuery: string;\n sortBy: string;\n}\n\nconst PAGE_SIZE = 10;\n\nconst statusOptions = [\n { value: '', label: 'All Status' },\n { value: 'pending', label: 'Pending' },\n { value: 'confirmed', label: 'Confirmed' },\n { value: 'preparing', label: 'Preparing' },\n { value: 'ready', label: 'Ready' },\n { value: 'out_for_delivery', label: 'Out for Delivery' },\n { value: 'delivered', label: 'Delivered' },\n { value: 'cancelled', label: 'Cancelled' },\n];\n\nconst dateRangeOptions = [\n { value: '7days', label: 'Last 7 Days' },\n { value: '30days', label: 'Last 30 Days' },\n { value: '90days', label: 'Last 90 Days' },\n { value: 'all', label: 'All Time' },\n];\n\nconst sortOptions = [\n { value: 'recent', label: 'Most Recent' },\n { value: 'oldest', label: 'Oldest First' },\n { value: 'amount_high', label: 'Amount: High to Low' },\n { value: 'amount_low', label: 'Amount: Low to High' },\n];\n\nexport function OrderHistoryPage() {\n const { navigateTo, currentUser } = useAdapterCloud();\n const [displayCount, setDisplayCount] = useState(PAGE_SIZE);\n const [filters, setFilters] = useState<OrderFilters>({\n status: '',\n dateRange: '30days',\n searchQuery: '',\n sortBy: 'recent',\n });\n\n const { data: allOrders = [], isLoading, isError } = useOrders({ customerId: currentUser?.id });\n\n // Calculate stats from all orders\n const orderStats = useMemo(() => {\n const totalOrders = allOrders.length;\n const totalSpent = allOrders.reduce((sum, o) => sum + o.total, 0);\n const averageOrderValue = totalOrders > 0 ? Math.round(totalSpent / totalOrders) : 0;\n const recentOrdersCount = allOrders.filter(\n (o) => new Date(o.orderDate) > new Date(Date.now() - 7 * 24 * 60 * 60 * 1000)\n ).length;\n\n // Find favorite cart (most ordered from)\n const cartCounts: Record<string, number> = {};\n for (const o of allOrders) {\n cartCounts[o.cartName] = (cartCounts[o.cartName] || 0) + 1;\n }\n const favoriteCart =\n Object.entries(cartCounts).sort((a, b) => b[1] - a[1])[0]?.[0] || 'No orders yet';\n\n return { totalOrders, totalSpent, averageOrderValue, recentOrdersCount, favoriteCart };\n }, [allOrders]);\n\n // Filter and sort orders\n const filteredOrders = useMemo(() => {\n let orders = [...allOrders];\n\n // Filter by status\n if (filters.status) {\n orders = orders.filter((o) => o.status === filters.status);\n }\n\n // Filter by date range\n if (filters.dateRange !== 'all') {\n const now = new Date();\n const dateLimit = new Date();\n switch (filters.dateRange) {\n case '7days':\n dateLimit.setDate(now.getDate() - 7);\n break;\n case '30days':\n dateLimit.setDate(now.getDate() - 30);\n break;\n case '90days':\n dateLimit.setDate(now.getDate() - 90);\n break;\n }\n orders = orders.filter((o) => new Date(o.orderDate) >= dateLimit);\n }\n\n // Search filter\n if (filters.searchQuery) {\n const query = filters.searchQuery.toLowerCase();\n orders = orders.filter(\n (o) =>\n o.id.toLowerCase().includes(query) ||\n o.cartName.toLowerCase().includes(query) ||\n o.items.some((item) => item.name.toLowerCase().includes(query))\n );\n }\n\n // Sort\n switch (filters.sortBy) {\n case 'recent':\n orders.sort((a, b) => new Date(b.orderDate).getTime() - new Date(a.orderDate).getTime());\n break;\n case 'oldest':\n orders.sort((a, b) => new Date(a.orderDate).getTime() - new Date(b.orderDate).getTime());\n break;\n case 'amount_high':\n orders.sort((a, b) => b.total - a.total);\n break;\n case 'amount_low':\n orders.sort((a, b) => a.total - b.total);\n break;\n }\n\n return orders;\n }, [allOrders, filters]);\n\n const displayedOrders = useMemo(\n () => filteredOrders.slice(0, displayCount),\n [filteredOrders, displayCount]\n );\n\n const hasMore = displayCount < filteredOrders.length;\n\n const handleFilterChange = (key: keyof OrderFilters, value: string) => {\n setFilters((prev) => ({ ...prev, [key]: value }));\n setDisplayCount(PAGE_SIZE);\n };\n\n const handleReorder = (order: MockOrder) => {\n navigateTo(`/customer/cart/${order.cartId}`);\n alert('Add items to cart to reorder');\n };\n\n const handleLoadMore = () => {\n setDisplayCount((prev) => prev + PAGE_SIZE);\n };\n\n if (isLoading) {\n return (\n <PageLayout title=\"Order History\" description=\"Loading your orders...\">\n <div className=\"flex h-[60vh] items-center justify-center\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n </PageLayout>\n );\n }\n\n if (isError) {\n return (\n <PageLayout title=\"Order History\" description=\"Error loading orders\">\n <div className=\"flex h-[60vh] flex-col items-center justify-center gap-4\">\n <AlertCircle className=\"h-12 w-12 text-destructive\" />\n <h2 className=\"text-xl font-semibold\">Error loading your orders</h2>\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n className=\"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground\"\n >\n Retry\n </button>\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout title=\"Order History\" description=\"View all your past and current orders\">\n {/* Stats Summary */}\n <div className=\"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3 mb-6\">\n <div className=\"rounded-lg border border-border bg-card p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <Package className=\"h-3.5 w-3.5 text-muted-foreground\" />\n <p className=\"text-xs text-muted-foreground\">Total Orders</p>\n </div>\n <p className=\"text-xl font-bold text-foreground\">{orderStats.totalOrders}</p>\n </div>\n <div className=\"rounded-lg border border-border bg-card p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <IndianRupee className=\"h-3.5 w-3.5 text-muted-foreground\" />\n <p className=\"text-xs text-muted-foreground\">Total Spent</p>\n </div>\n <p className=\"text-xl font-bold text-foreground\">\n {formatCurrency(orderStats.totalSpent, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div className=\"rounded-lg border border-border bg-card p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <TrendingUp className=\"h-3.5 w-3.5 text-muted-foreground\" />\n <p className=\"text-xs text-muted-foreground\">Average Order</p>\n </div>\n <p className=\"text-xl font-bold text-foreground\">\n {formatCurrency(orderStats.averageOrderValue, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div className=\"rounded-lg border border-border bg-card p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <Clock className=\"h-3.5 w-3.5 text-muted-foreground\" />\n <p className=\"text-xs text-muted-foreground\">Recent Orders</p>\n </div>\n <p className=\"text-xl font-bold text-foreground\">{orderStats.recentOrdersCount}</p>\n </div>\n <div className=\"rounded-lg border border-border bg-card p-3.5 col-span-2 md:col-span-1\">\n <div className=\"flex items-center gap-2 mb-1\">\n <Heart className=\"h-3.5 w-3.5 text-muted-foreground\" />\n <p className=\"text-xs text-muted-foreground\">Favorite Cart</p>\n </div>\n <p className=\"text-sm font-bold text-foreground truncate\">{orderStats.favoriteCart}</p>\n </div>\n </div>\n\n {/* Filters */}\n <div className=\"rounded-lg border border-border bg-card p-4 mb-6\">\n <div className=\"grid grid-cols-1 md:grid-cols-4 gap-3\">\n {/* Search */}\n <div className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground\" />\n <input\n type=\"text\"\n placeholder=\"Search orders...\"\n value={filters.searchQuery}\n onChange={(e) => handleFilterChange('searchQuery', e.target.value)}\n className=\"w-full rounded-lg border border-border bg-background pl-9 pr-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n\n {/* Status Filter */}\n <select\n value={filters.status}\n onChange={(e) => handleFilterChange('status', e.target.value)}\n className=\"w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n >\n {statusOptions.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n\n {/* Date Range */}\n <select\n value={filters.dateRange}\n onChange={(e) => handleFilterChange('dateRange', e.target.value)}\n className=\"w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n >\n {dateRangeOptions.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n\n {/* Sort */}\n <select\n value={filters.sortBy}\n onChange={(e) => handleFilterChange('sortBy', e.target.value)}\n className=\"w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n >\n {sortOptions.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n </div>\n\n {/* Orders List */}\n {isLoading ? (\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <div className=\"animate-spin rounded-full h-12 w-12 border-b-2 border-foreground mx-auto mb-4\" />\n <p className=\"text-sm text-muted-foreground\">Loading orders...</p>\n </div>\n ) : displayedOrders.length === 0 ? (\n <EmptyState\n icon={<ShoppingBag className=\"h-12 w-12\" />}\n title=\"No orders found\"\n description={\n filters.searchQuery || filters.status\n ? 'Try adjusting your filters'\n : \"You haven't placed any orders yet\"\n }\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/carts')}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Start Ordering\n </button>\n }\n />\n ) : (\n <div className=\"space-y-4\">\n {displayedOrders.map((order) => (\n <div\n key={order.id}\n className=\"rounded-lg border border-border bg-card hover:shadow-md transition-shadow\"\n >\n <div className=\"p-4 md:p-5\">\n {/* Order Header */}\n <div className=\"flex flex-col md:flex-row md:items-center justify-between mb-3\">\n <div className=\"mb-3 md:mb-0\">\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-2\">\n <h3 className=\"text-base font-semibold text-foreground\">{order.cartName}</h3>\n <StatusBadge status={order.status} />\n </div>\n <p className=\"text-xs text-muted-foreground mt-1\">\n Order #{order.id} · {formatDate(order.orderDate)}\n </p>\n </div>\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-2\">\n <p className=\"text-lg font-bold text-foreground\">\n {formatCurrency(order.total, { minimumFractionDigits: 0 })}\n </p>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/orders/${order.id}`)}\n className=\"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent transition-colors\"\n >\n <Eye className=\"h-3 w-3\" />\n Track Order\n </button>\n {order.status === 'delivered' && (\n <button\n type=\"button\"\n onClick={() => handleReorder(order)}\n className=\"flex items-center gap-1.5 rounded-lg bg-foreground px-3 py-1.5 text-xs font-medium text-background hover:opacity-90 transition-opacity\"\n >\n <RotateCcw className=\"h-3 w-3\" />\n Reorder\n </button>\n )}\n </div>\n </div>\n </div>\n\n {/* Order Items Summary */}\n <div className=\"border-t border-border pt-3\">\n <div className=\"flex flex-wrap gap-1\">\n {order.items.slice(0, 3).map((item, index) => (\n <span key={index} className=\"text-xs text-muted-foreground\">\n {item.name} ({item.quantity})\n {index < Math.min(2, order.items.length - 1) && ', '}\n </span>\n ))}\n {order.items.length > 3 && (\n <span className=\"text-xs text-muted-foreground\">\n +{order.items.length - 3} more items\n </span>\n )}\n </div>\n </div>\n\n {/* Status Message */}\n <div className=\"mt-3\">\n {order.status === 'delivered' && (\n <div className=\"flex items-center gap-1.5 text-xs text-green-600 dark:text-green-400\">\n <CheckCircle2 className=\"h-3 w-3\" />\n <span>Order delivered successfully</span>\n </div>\n )}\n {order.status === 'cancelled' && (\n <div className=\"flex items-center gap-1.5 text-xs text-destructive\">\n <XCircle className=\"h-3 w-3\" />\n <span>\n Cancelled{order.cancellationReason && ` - ${order.cancellationReason}`}\n </span>\n </div>\n )}\n {['pending', 'confirmed', 'preparing', 'ready', 'out_for_delivery'].includes(\n order.status\n ) && (\n <div className=\"flex items-center gap-1.5 text-xs text-blue-600 dark:text-blue-400\">\n <Truck className=\"h-3 w-3\" />\n <span>\n Estimated delivery by{' '}\n {order.estimatedDeliveryTime\n ? formatDate(order.estimatedDeliveryTime)\n : 'TBD'}\n </span>\n </div>\n )}\n </div>\n\n {/* Rating Section */}\n {order.status === 'delivered' && (\n <div className=\"mt-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2\">\n {order.rating ? (\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-2\">\n <RatingDisplay value={order.rating} />\n {order.review && (\n <p className=\"text-xs text-muted-foreground italic\">\n “{order.review}”\n </p>\n )}\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/orders/${order.id}/rate`)}\n className=\"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent transition-colors\"\n >\n <Star className=\"h-3 w-3\" />\n Rate Order\n </button>\n )}\n </div>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Load More */}\n {hasMore && !isLoading && (\n <div className=\"text-center mt-8\">\n <button\n type=\"button\"\n onClick={handleLoadMore}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border px-6 py-2.5 text-sm font-medium text-foreground hover:bg-accent transition-colors\"\n >\n <ChevronDown className=\"h-4 w-4\" />\n Load More Orders\n </button>\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;AA4CA,IAAM,IAAY,IAEZ,IAAgB;CACpB;EAAE,OAAO;EAAI,OAAO;EAAc;CAClC;EAAE,OAAO;EAAW,OAAO;EAAW;CACtC;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAS,OAAO;EAAS;CAClC;E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[],"sources":["../../../../src/adaptercloud/pages/customer/OrderHistoryPage.tsx"],"sourcesContent":["/**\n * Order History Page\n * @module adaptercloud/pages/customer\n *\n * Full list of customer orders with stats summary, search, status/date/sort\n * filters, rating display, reorder, cancellation reason, and Load More pagination.\n */\n\nimport { useState, useMemo, useCallback, useEffect } from'react';\nimport {\n ShoppingBag,\n Search,\n Star,\n RotateCcw,\n Eye,\n ChevronDown,\n Package,\n IndianRupee,\n TrendingUp,\n Clock,\n Heart,\n CheckCircle2,\n XCircle,\n Truck,\n Loader2,\n AlertCircle,\n} from'lucide-react';\nimport { PageLayout } from'../../components/PageLayout';\nimport { StatusBadge } from'../../components/StatusBadge';\nimport { EmptyState } from'../../components/EmptyState';\nimport { RatingDisplay } from'../../components/RatingDisplay';\nimport { useAdapterCloud } from'../../context/AdapterCloudContext';\nimport { useOrders } from'../../hooks/useAdapterCloudApi';\nimport { cn } from'../../utils/cn';\nimport { formatCurrency, formatDate } from'../../utils/formatters';\nimport type { OrderStatus, MockOrder } from'../../types';\n\ninterface OrderFilters {\n status: string;\n dateRange: string;\n searchQuery: string;\n sortBy: string;\n}\n\nconst PAGE_SIZE = 10;\n\nconst statusOptions = [\n { value: '', label: 'All Status' },\n { value: 'pending', label: 'Pending' },\n { value: 'confirmed', label: 'Confirmed' },\n { value: 'preparing', label: 'Preparing' },\n { value: 'ready', label: 'Ready' },\n { value: 'out_for_delivery', label: 'Out for Delivery' },\n { value: 'delivered', label: 'Delivered' },\n { value: 'cancelled', label: 'Cancelled' },\n];\n\nconst dateRangeOptions = [\n { value: '7days', label: 'Last 7 Days' },\n { value: '30days', label: 'Last 30 Days' },\n { value: '90days', label: 'Last 90 Days' },\n { value: 'all', label: 'All Time' },\n];\n\nconst sortOptions = [\n { value: 'recent', label: 'Most Recent' },\n { value: 'oldest', label: 'Oldest First' },\n { value: 'amount_high', label: 'Amount: High to Low' },\n { value: 'amount_low', label: 'Amount: Low to High' },\n];\n\nexport function OrderHistoryPage() {\n const { navigateTo, currentUser } = useAdapterCloud();\n const [displayCount, setDisplayCount] = useState(PAGE_SIZE);\n const [filters, setFilters] = useState<OrderFilters>({\n status: '',\n dateRange: '30days',\n searchQuery: '',\n sortBy: 'recent',\n });\n\n const { data: allOrders = [], isLoading, isError } = useOrders({ customerId: currentUser?.id });\n\n // Calculate stats from all orders\n const orderStats = useMemo(() => {\n const totalOrders = allOrders.length;\n const totalSpent = allOrders.reduce((sum, o) => sum + o.total, 0);\n const averageOrderValue = totalOrders > 0 ? Math.round(totalSpent / totalOrders) : 0;\n const recentOrdersCount = allOrders.filter(\n (o) => new Date(o.orderDate) > new Date(Date.now() - 7 * 24 * 60 * 60 * 1000)\n ).length;\n\n // Find favorite cart (most ordered from)\n const cartCounts: Record<string, number> = {};\n for (const o of allOrders) {\n cartCounts[o.cartName] = (cartCounts[o.cartName] || 0) + 1;\n }\n const favoriteCart =\n Object.entries(cartCounts).sort((a, b) => b[1] - a[1])[0]?.[0] || 'No orders yet';\n\n return { totalOrders, totalSpent, averageOrderValue, recentOrdersCount, favoriteCart };\n }, [allOrders]);\n\n // Filter and sort orders\n const filteredOrders = useMemo(() => {\n let orders = [...allOrders];\n\n // Filter by status\n if (filters.status) {\n orders = orders.filter((o) => o.status === filters.status);\n }\n\n // Filter by date range\n if (filters.dateRange !== 'all') {\n const now = new Date();\n const dateLimit = new Date();\n switch (filters.dateRange) {\n case'7days':\n dateLimit.setDate(now.getDate() - 7);\n break;\n case'30days':\n dateLimit.setDate(now.getDate() - 30);\n break;\n case'90days':\n dateLimit.setDate(now.getDate() - 90);\n break;\n }\n orders = orders.filter((o) => new Date(o.orderDate) >= dateLimit);\n }\n\n // Search filter\n if (filters.searchQuery) {\n const query = filters.searchQuery.toLowerCase();\n orders = orders.filter(\n (o) =>\n o.id.toLowerCase().includes(query) ||\n o.cartName.toLowerCase().includes(query) ||\n o.items.some((item) => item.name.toLowerCase().includes(query))\n );\n }\n\n // Sort\n switch (filters.sortBy) {\n case'recent':\n orders.sort((a, b) => new Date(b.orderDate).getTime() - new Date(a.orderDate).getTime());\n break;\n case'oldest':\n orders.sort((a, b) => new Date(a.orderDate).getTime() - new Date(b.orderDate).getTime());\n break;\n case'amount_high':\n orders.sort((a, b) => b.total - a.total);\n break;\n case'amount_low':\n orders.sort((a, b) => a.total - b.total);\n break;\n }\n\n return orders;\n }, [allOrders, filters]);\n\n const displayedOrders = useMemo(\n () => filteredOrders.slice(0, displayCount),\n [filteredOrders, displayCount]\n );\n\n const hasMore = displayCount < filteredOrders.length;\n\n const handleFilterChange = (key: keyof OrderFilters, value: string) => {\n setFilters((prev) => ({ ...prev, [key]: value }));\n setDisplayCount(PAGE_SIZE);\n };\n\n const handleReorder = (order: MockOrder) => {\n navigateTo(`/customer/cart/${order.cartId}`);\n alert('Add items to cart to reorder');\n };\n\n const handleLoadMore = () => {\n setDisplayCount((prev) => prev + PAGE_SIZE);\n };\n\n if (isLoading) {\n return (\n <PageLayout title=\"Order History\" description=\"Loading your orders...\">\n <div className=\"flex h-[60vh] items-center justify-center\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n </PageLayout>\n );\n }\n\n if (isError) {\n return (\n <PageLayout title=\"Order History\" description=\"Error loading orders\">\n <div className=\"flex h-[60vh] flex-col items-center justify-center gap-4\">\n <AlertCircle className=\"h-12 w-12 text-status-error-text\" />\n <h2 className=\"text-xl font-semibold\">Error loading your orders</h2>\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n Retry\n </button>\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout title=\"Order History\" description=\"View all your past and current orders\">\n {/* Stats Summary */}\n <div className=\"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3 mb-6\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <Package className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Total Orders</p>\n </div>\n <p className=\"text-xl font-bold text-text-primary\">{orderStats.totalOrders}</p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <IndianRupee className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Total Spent</p>\n </div>\n <p className=\"text-xl font-bold text-text-primary\">\n {formatCurrency(orderStats.totalSpent, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <TrendingUp className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Average Order</p>\n </div>\n <p className=\"text-xl font-bold text-text-primary\">\n {formatCurrency(orderStats.averageOrderValue, { minimumFractionDigits: 0 })}\n </p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-3.5\">\n <div className=\"flex items-center gap-2 mb-1\">\n <Clock className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Recent Orders</p>\n </div>\n <p className=\"text-xl font-bold text-text-primary\">{orderStats.recentOrdersCount}</p>\n </div>\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-3.5 col-span-2 md:col-span-1\">\n <div className=\"flex items-center gap-2 mb-1\">\n <Heart className=\"h-3.5 w-3.5 text-text-secondary\" />\n <p className=\"text-xs text-text-secondary\">Favorite Cart</p>\n </div>\n <p className=\"text-sm font-bold text-text-primary truncate\">{orderStats.favoriteCart}</p>\n </div>\n </div>\n\n {/* Filters */}\n <div className=\"rounded-lg border border-border-seam bg-bg-surface p-4 mb-6 bg-gloss-card shadow-pop\">\n <div className=\"grid grid-cols-1 md:grid-cols-4 gap-3\">\n {/* Search */}\n <div className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary\" />\n <input\n type=\"text\"\n placeholder=\"Search orders...\"\n value={filters.searchQuery}\n onChange={(e) => handleFilterChange('searchQuery', e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface pl-9 pr-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n\n {/* Status Filter */}\n <select\n value={filters.status}\n onChange={(e) => handleFilterChange('status', e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n {statusOptions.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n\n {/* Date Range */}\n <select\n value={filters.dateRange}\n onChange={(e) => handleFilterChange('dateRange', e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n {dateRangeOptions.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n\n {/* Sort */}\n <select\n value={filters.sortBy}\n onChange={(e) => handleFilterChange('sortBy', e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n {sortOptions.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n </div>\n\n {/* Orders List */}\n {isLoading ? (\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <div className=\"animate-spin rounded-full h-12 w-12 border-b-2 border-foreground mx-auto mb-4\" />\n <p className=\"text-sm text-text-secondary\">Loading orders...</p>\n </div>\n ) : displayedOrders.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n icon={<ShoppingBag className=\"h-12 w-12\" />}\n title=\"No orders found\"\n description={\n filters.searchQuery || filters.status\n ? 'Try adjusting your filters'\n : \"You haven't placed any orders yet\"\n }\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/carts')}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Start Ordering\n </button>\n }\n />\n ) : (\n <div className=\"space-y-4\">\n {displayedOrders.map((order) => (\n <div\n key={order.id}\n className=\"rounded-lg border border-border-subtle bg-bg-surface hover:shadow-md transition-shadow\"\n >\n <div className=\"p-4 md:p-5\">\n {/* Order Header */}\n <div className=\"flex flex-col md:flex-row md:items-center justify-between mb-3\">\n <div className=\"mb-3 md:mb-0\">\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-2\">\n <h3 className=\"text-base font-semibold text-text-primary\">{order.cartName}</h3>\n <StatusBadge status={order.status} />\n </div>\n <p className=\"text-xs text-text-secondary mt-1\">\n Order #{order.id} · {formatDate(order.orderDate)}\n </p>\n </div>\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-2\">\n <p className=\"text-lg font-bold text-text-primary\">\n {formatCurrency(order.total, { minimumFractionDigits: 0 })}\n </p>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/orders/${order.id}`)}\n className=\"flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Eye className=\"h-3 w-3\" />\n Track Order\n </button>\n {order.status === 'delivered' && (\n <button\n type=\"button\"\n onClick={() => handleReorder(order)}\n className=\"flex items-center gap-1.5 rounded-lg bg-foreground px-3 py-1.5 text-xs font-medium text-background hover:opacity-90 transition-opacity\"\n >\n <RotateCcw className=\"h-3 w-3\" />\n Reorder\n </button>\n )}\n </div>\n </div>\n </div>\n\n {/* Order Items Summary */}\n <div className=\"border-t border-border-subtle pt-3\">\n <div className=\"flex flex-wrap gap-1\">\n {order.items.slice(0, 3).map((item, index) => (\n <span key={index} className=\"text-xs text-text-secondary\">\n {item.name} ({item.quantity})\n {index < Math.min(2, order.items.length - 1) && ', '}\n </span>\n ))}\n {order.items.length > 3 && (\n <span className=\"text-xs text-text-secondary\">\n +{order.items.length - 3} more items\n </span>\n )}\n </div>\n </div>\n\n {/* Status Message */}\n <div className=\"mt-3\">\n {order.status === 'delivered' && (\n <div className=\"flex items-center gap-1.5 text-xs text-status-success-text\">\n <CheckCircle2 className=\"h-3 w-3\" />\n <span>Order delivered successfully</span>\n </div>\n )}\n {order.status === 'cancelled' && (\n <div className=\"flex items-center gap-1.5 text-xs text-status-error-text\">\n <XCircle className=\"h-3 w-3\" />\n <span>\n Cancelled{order.cancellationReason && ` - ${order.cancellationReason}`}\n </span>\n </div>\n )}\n {['pending', 'confirmed', 'preparing', 'ready', 'out_for_delivery'].includes(\n order.status\n ) && (\n <div className=\"flex items-center gap-1.5 text-xs text-accent-blue\">\n <Truck className=\"h-3 w-3\" />\n <span>\n Estimated delivery by{' '}\n {order.estimatedDeliveryTime\n ? formatDate(order.estimatedDeliveryTime)\n : 'TBD'}\n </span>\n </div>\n )}\n </div>\n\n {/* Rating Section */}\n {order.status === 'delivered' && (\n <div className=\"mt-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2\">\n {order.rating ? (\n <div className=\"flex flex-col sm:flex-row sm:items-center gap-2\">\n <RatingDisplay value={order.rating} />\n {order.review && (\n <p className=\"text-xs text-text-secondary italic\">\n “{order.review}”\n </p>\n )}\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/orders/${order.id}/rate`)}\n className=\"flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Star className=\"h-3 w-3\" />\n Rate Order\n </button>\n )}\n </div>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Load More */}\n {hasMore && !isLoading && (\n <div className=\"text-center mt-8\">\n <button\n type=\"button\"\n onClick={handleLoadMore}\n className=\"inline-flex items-center gap-2 rounded-lg border border-border-subtle px-6 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <ChevronDown className=\"h-4 w-4\" />\n Load More Orders\n </button>\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;AA4CA,IAAM,IAAY,IAEZ,IAAgB;CACpB;EAAE,OAAO;EAAI,OAAO;EAAc;CAClC;EAAE,OAAO;EAAW,OAAO;EAAW;CACtC;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAS,OAAO;EAAS;CAClC;EAAE,OAAO;EAAoB,OAAO;EAAoB;CACxD;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAa,OAAO;EAAa;CAC3C,EAEK,IAAmB;CACvB;EAAE,OAAO;EAAS,OAAO;EAAe;CACxC;EAAE,OAAO;EAAU,OAAO;EAAgB;CAC1C;EAAE,OAAO;EAAU,OAAO;EAAgB;CAC1C;EAAE,OAAO;EAAO,OAAO;EAAY;CACpC,EAEK,IAAc;CAClB;EAAE,OAAO;EAAU,OAAO;EAAe;CACzC;EAAE,OAAO;EAAU,OAAO;EAAgB;CAC1C;EAAE,OAAO;EAAe,OAAO;EAAuB;CACtD;EAAE,OAAO;EAAc,OAAO;EAAuB;CACtD;AAED,SAAgB,IAAmB;CACjC,IAAM,EAAE,eAAY,mBAAgB,GAAiB,EAC/C,CAAC,GAAc,KAAmB,EAAS,EAAU,EACrD,CAAC,GAAS,KAAc,EAAuB;EACnD,QAAQ;EACR,WAAW;EACX,aAAa;EACb,QAAQ;EACT,CAAC,EAEI,EAAE,MAAM,IAAY,EAAE,EAAE,cAAW,eAAY,EAAU,EAAE,YAAY,GAAa,IAAI,CAAC,EAGzF,IAAa,QAAc;EAC/B,IAAM,IAAc,EAAU,QACxB,IAAa,EAAU,QAAQ,GAAK,MAAM,IAAM,EAAE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