@burdenoff/microfe-kadaikodi 2026.704.3 → 2026.704.5

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.
Files changed (145) hide show
  1. package/dist/kadaikodi/KadaikodiRoutes.js +34 -26
  2. package/dist/kadaikodi/KadaikodiRoutes.js.map +1 -1
  3. package/dist/kadaikodi/components/viz/AllocationBar.js +68 -0
  4. package/dist/kadaikodi/components/viz/AllocationBar.js.map +1 -0
  5. package/dist/kadaikodi/components/viz/AreaChart.js +102 -0
  6. package/dist/kadaikodi/components/viz/AreaChart.js.map +1 -0
  7. package/dist/kadaikodi/components/viz/AvatarStack.js +36 -0
  8. package/dist/kadaikodi/components/viz/AvatarStack.js.map +1 -0
  9. package/dist/kadaikodi/components/viz/BarChart.js +83 -0
  10. package/dist/kadaikodi/components/viz/BarChart.js.map +1 -0
  11. package/dist/kadaikodi/components/viz/CertificateCard.js +4 -0
  12. package/dist/kadaikodi/components/viz/DonutChart.js +109 -0
  13. package/dist/kadaikodi/components/viz/DonutChart.js.map +1 -0
  14. package/dist/kadaikodi/components/viz/HBarFunnel.js +54 -0
  15. package/dist/kadaikodi/components/viz/HBarFunnel.js.map +1 -0
  16. package/dist/kadaikodi/components/viz/Heatmap.js +3 -0
  17. package/dist/kadaikodi/components/viz/KanbanBoard.js +50 -0
  18. package/dist/kadaikodi/components/viz/KanbanBoard.js.map +1 -0
  19. package/dist/kadaikodi/components/viz/LineChart.js +4 -0
  20. package/dist/kadaikodi/components/viz/OrgTree.js +2 -0
  21. package/dist/kadaikodi/components/viz/PathSteps.js +3 -0
  22. package/dist/kadaikodi/components/viz/ProgressRing.js +68 -0
  23. package/dist/kadaikodi/components/viz/ProgressRing.js.map +1 -0
  24. package/dist/kadaikodi/components/viz/RatingStars.js +51 -0
  25. package/dist/kadaikodi/components/viz/RatingStars.js.map +1 -0
  26. package/dist/kadaikodi/components/viz/SegmentedTabs.js +69 -0
  27. package/dist/kadaikodi/components/viz/SegmentedTabs.js.map +1 -0
  28. package/dist/kadaikodi/components/viz/SkillBar.js +3 -0
  29. package/dist/kadaikodi/components/viz/Sparkline.js +74 -0
  30. package/dist/kadaikodi/components/viz/Sparkline.js.map +1 -0
  31. package/dist/kadaikodi/components/viz/StatCard.js +60 -0
  32. package/dist/kadaikodi/components/viz/StatCard.js.map +1 -0
  33. package/dist/kadaikodi/components/viz/StepProgress.js +64 -0
  34. package/dist/kadaikodi/components/viz/StepProgress.js.map +1 -0
  35. package/dist/kadaikodi/components/viz/Timeline.js +66 -0
  36. package/dist/kadaikodi/components/viz/Timeline.js.map +1 -0
  37. package/dist/kadaikodi/components/viz/index.js +23 -0
  38. package/dist/kadaikodi/components/viz/lib/Avatar.js +30 -0
  39. package/dist/kadaikodi/components/viz/lib/Avatar.js.map +1 -0
  40. package/dist/kadaikodi/components/viz/lib/CartesianFrame.js +119 -0
  41. package/dist/kadaikodi/components/viz/lib/CartesianFrame.js.map +1 -0
  42. package/dist/kadaikodi/components/viz/lib/ResponsiveSvg.js +35 -0
  43. package/dist/kadaikodi/components/viz/lib/ResponsiveSvg.js.map +1 -0
  44. package/dist/kadaikodi/components/viz/lib/format.js +21 -0
  45. package/dist/kadaikodi/components/viz/lib/format.js.map +1 -0
  46. package/dist/kadaikodi/components/viz/lib/geometry.js +61 -0
  47. package/dist/kadaikodi/components/viz/lib/geometry.js.map +1 -0
  48. package/dist/kadaikodi/components/viz/lib/hooks.js +39 -0
  49. package/dist/kadaikodi/components/viz/lib/hooks.js.map +1 -0
  50. package/dist/kadaikodi/components/viz/lib/palette.js +27 -0
  51. package/dist/kadaikodi/components/viz/lib/palette.js.map +1 -0
  52. package/dist/kadaikodi/hooks/useKadaikodiApi.js +84 -6
  53. package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
  54. package/dist/kadaikodi/pages/HomePage.js +373 -631
  55. package/dist/kadaikodi/pages/HomePage.js.map +1 -1
  56. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +304 -169
  57. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
  58. package/dist/kadaikodi/pages/admin/AdminDashboard.js +255 -271
  59. package/dist/kadaikodi/pages/admin/AdminDashboard.js.map +1 -1
  60. package/dist/kadaikodi/pages/admin/AdminFinancialPage.js +185 -125
  61. package/dist/kadaikodi/pages/admin/AdminFinancialPage.js.map +1 -1
  62. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +141 -102
  63. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
  64. package/dist/kadaikodi/pages/admin/AdminProfilePage.js.map +1 -1
  65. package/dist/kadaikodi/pages/admin/AdminSettingsPage.js +332 -276
  66. package/dist/kadaikodi/pages/admin/AdminSettingsPage.js.map +1 -1
  67. package/dist/kadaikodi/pages/admin/CartManagementPage.js +564 -729
  68. package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
  69. package/dist/kadaikodi/pages/admin/UserManagementPage.js +310 -366
  70. package/dist/kadaikodi/pages/admin/UserManagementPage.js.map +1 -1
  71. package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js +201 -120
  72. package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
  73. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js +290 -257
  74. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
  75. package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +173 -194
  76. package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
  77. package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js +270 -228
  78. package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
  79. package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +194 -173
  80. package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
  81. package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js +428 -347
  82. package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js.map +1 -1
  83. package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.js +332 -0
  84. package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.js.map +1 -0
  85. package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js +373 -0
  86. package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js.map +1 -0
  87. package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +294 -162
  88. package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
  89. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +180 -181
  90. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
  91. package/dist/kadaikodi/pages/common/HelpSupportPage.js +310 -317
  92. package/dist/kadaikodi/pages/common/HelpSupportPage.js.map +1 -1
  93. package/dist/kadaikodi/pages/common/NotificationCenterPage.js.map +1 -1
  94. package/dist/kadaikodi/pages/common/SettingsPage.js +502 -586
  95. package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
  96. package/dist/kadaikodi/pages/customer/BookingDetailsPage.js +239 -156
  97. package/dist/kadaikodi/pages/customer/BookingDetailsPage.js.map +1 -1
  98. package/dist/kadaikodi/pages/customer/CartDetailPage.js +405 -248
  99. package/dist/kadaikodi/pages/customer/CartDetailPage.js.map +1 -1
  100. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js +258 -232
  101. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js.map +1 -1
  102. package/dist/kadaikodi/pages/customer/CheckoutPage.js +254 -205
  103. package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
  104. package/dist/kadaikodi/pages/customer/CustomerDashboard.js +5 -5
  105. package/dist/kadaikodi/pages/customer/CustomerDashboard.js.map +1 -1
  106. package/dist/kadaikodi/pages/customer/CustomerProfilePage.js +189 -199
  107. package/dist/kadaikodi/pages/customer/CustomerProfilePage.js.map +1 -1
  108. package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js +272 -230
  109. package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
  110. package/dist/kadaikodi/pages/customer/FavoritesPage.js +150 -413
  111. package/dist/kadaikodi/pages/customer/FavoritesPage.js.map +1 -1
  112. package/dist/kadaikodi/pages/customer/OrderHistoryPage.js +173 -134
  113. package/dist/kadaikodi/pages/customer/OrderHistoryPage.js.map +1 -1
  114. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +411 -305
  115. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
  116. package/dist/kadaikodi/pages/customer/ReviewsPage.js +310 -406
  117. package/dist/kadaikodi/pages/customer/ReviewsPage.js.map +1 -1
  118. package/dist/kadaikodi/pages/customer/SavedAddressesPage.js.map +1 -1
  119. package/dist/kadaikodi/pages/customer/shared.js +181 -0
  120. package/dist/kadaikodi/pages/customer/shared.js.map +1 -0
  121. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js +438 -311
  122. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js.map +1 -1
  123. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js +320 -293
  124. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
  125. package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js +159 -91
  126. package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js.map +1 -1
  127. package/dist/kadaikodi/pages/investor/InvestorDashboard.js +137 -107
  128. package/dist/kadaikodi/pages/investor/InvestorDashboard.js.map +1 -1
  129. package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js +157 -135
  130. package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js.map +1 -1
  131. package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js +280 -206
  132. package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js.map +1 -1
  133. package/dist/kadaikodi/pages/investor/InvestorProfilePage.js +441 -514
  134. package/dist/kadaikodi/pages/investor/InvestorProfilePage.js.map +1 -1
  135. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +428 -431
  136. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
  137. package/dist/kadaikodi/pages/worker/WorkerDashboard.js +328 -445
  138. package/dist/kadaikodi/pages/worker/WorkerDashboard.js.map +1 -1
  139. package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js +141 -164
  140. package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js.map +1 -1
  141. package/dist/kadaikodi/pages/worker/WorkerProfilePage.js +360 -288
  142. package/dist/kadaikodi/pages/worker/WorkerProfilePage.js.map +1 -1
  143. package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js +303 -281
  144. package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js.map +1 -1
  145. package/package.json +1 -1
@@ -1,828 +1,663 @@
1
- import { useKadaikodi as e } from "../../context/KadaikodiContext.js";
2
- import { cn as t } from "../../utils/cn.js";
3
- import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { EmptyState as r } from "../../components/EmptyState.js";
5
- import { useProviders as i } from "../../hooks/useKadaikodiApi.js";
6
- import { formatCurrency as a } from "../../utils/formatters.js";
7
- import { useMemo as o, useState as s } from "react";
8
- import { CheckCircle2 as c, ClipboardCheck as l, Eye as u, Loader2 as d, Pause as f, Search as p, Star as m, Store as h, X as g, XCircle as _ } from "lucide-react";
9
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
10
- import { EmphasisPanel as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
1
+ import { cn as e } from "../../utils/cn.js";
2
+ import { PageLayout as t } from "../../components/PageLayout.js";
3
+ import { EmptyState as n } from "../../components/EmptyState.js";
4
+ import { useProviders as r, useUpdateProvider as ee } from "../../hooks/useKadaikodiApi.js";
5
+ import { formatCurrency as te } from "../../utils/formatters.js";
6
+ import { StatCard as i } from "../../components/viz/StatCard.js";
7
+ import { SegmentedTabs as a } from "../../components/viz/SegmentedTabs.js";
8
+ import "../../components/viz/index.js";
9
+ import { Fragment as o, useMemo as s, useState as c } from "react";
10
+ import { AlertCircle as l, Calendar as u, CheckCircle2 as d, ChevronDown as f, FileText as ne, IndianRupee as p, Loader2 as re, MapPin as ie, Search as m, Star as h, Store as g, X as _ } from "lucide-react";
11
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
12
+ import { GlassCard as ae, PagePurpose as oe } from "@burdenoff/fe-libs/ui";
11
13
  //#region src/kadaikodi/pages/admin/CartManagementPage.tsx
12
- function C(e) {
14
+ var b = (e) => e.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (e) => e.toUpperCase());
15
+ function se(e) {
16
+ let t = e.isVerified ? "verified" : e.isOpen ? "pending" : "inactive";
13
17
  return {
14
18
  id: e.id,
15
19
  name: e.name,
16
- description: "",
17
20
  category: e.category,
18
- image: "",
19
- ownerName: "",
20
- ownerEmail: "",
21
- ownerPhone: "",
21
+ ownerId: e.ownerId ?? "",
22
22
  address: e.location?.address ?? "",
23
- city: "",
24
- isActive: e.isOpen,
25
- isVerified: e.isVerified ?? !1,
26
23
  rating: e.rating,
27
24
  reviewCount: e.totalRatings,
28
- monthlyRevenue: 0,
29
- monthlyOrders: 0,
30
- complianceScore: 0,
31
- documentsSubmitted: 0,
32
- documentsRequired: 0,
33
- inspectionStatus: e.isVerified ? "completed" : "pending",
34
- applicationDate: e.createdAt ?? (/* @__PURE__ */ new Date()).toISOString()
25
+ avgOrderValue: e.averageOrderValue ?? 0,
26
+ serviceTypes: e.serviceTypes ?? [],
27
+ isOpen: e.isOpen,
28
+ isVerified: e.isVerified ?? !1,
29
+ status: t,
30
+ createdAt: e.createdAt ?? (/* @__PURE__ */ new Date()).toISOString()
35
31
  };
36
32
  }
37
- function w() {
38
- let { navigateTo: w } = e(), { data: T = [], isLoading: E } = i(), [D, O] = s(null), [k, A] = s(!1), [j, M] = s("view"), [N, P] = s(""), [F, I] = s({
39
- searchQuery: "",
40
- status: "",
41
- verificationStatus: "",
42
- category: "",
43
- location: "",
44
- sortBy: "recent"
45
- }), L = o(() => T.map(C), [T]), R = o(() => {
46
- let e = L.filter((e) => e.isActive).length, t = L.filter((e) => !e.isVerified).length, n = L.length ? L.reduce((e, t) => e + t.rating, 0) / L.length : 0;
47
- return {
48
- totalCarts: L.length,
49
- activeCarts: e,
50
- pendingApproval: t,
51
- rejectedCarts: 0,
52
- totalRevenue: 0,
53
- averageRating: Number(n.toFixed(1)),
54
- complianceRate: 0,
55
- newApplications: t
56
- };
57
- }, [L]), z = o(() => {
58
- let e = [...L];
59
- if (F.searchQuery) {
60
- let t = F.searchQuery.toLowerCase();
61
- e = e.filter((e) => e.name.toLowerCase().includes(t) || e.ownerName.toLowerCase().includes(t) || e.description.toLowerCase().includes(t) || e.address.toLowerCase().includes(t));
33
+ var x = {
34
+ verified: {
35
+ label: "Verified",
36
+ cls: "bg-status-success-bg-subtle text-status-success-text"
37
+ },
38
+ pending: {
39
+ label: "Pending",
40
+ cls: "bg-status-warning-bg-subtle text-status-warning-text"
41
+ },
42
+ inactive: {
43
+ label: "Inactive",
44
+ cls: "bg-bg-sunken text-text-secondary"
45
+ }
46
+ };
47
+ function S() {
48
+ let { data: S = [], isLoading: ce } = r(), C = ee(), [w, T] = c(null), E = (e, t) => {
49
+ T({
50
+ text: e,
51
+ type: t
52
+ }), setTimeout(() => T(null), 3500);
53
+ }, [D, O] = c("all"), [k, A] = c(""), [j, M] = c(""), [N, P] = c("recent"), [F, I] = c(null), [L, R] = c(null), [z, B] = c("approve"), [V, H] = c(!1), [U, W] = c(""), G = s(() => S.map(se), [S]), K = s(() => ({
54
+ all: G.length,
55
+ verified: G.filter((e) => e.status === "verified").length,
56
+ pending: G.filter((e) => e.status === "pending").length,
57
+ inactive: G.filter((e) => e.status === "inactive").length
58
+ }), [G]), q = s(() => {
59
+ let e = G.filter((e) => e.rating > 0);
60
+ return e.length === 0 ? 0 : e.reduce((e, t) => e + t.rating, 0) / e.length;
61
+ }, [G]), le = s(() => Array.from(new Set(G.map((e) => e.category))).sort(), [G]), J = s(() => {
62
+ let e = [...G];
63
+ if (D !== "all" && (e = e.filter((e) => e.status === D)), j && (e = e.filter((e) => e.category === j)), k) {
64
+ let t = k.toLowerCase();
65
+ e = e.filter((e) => e.name.toLowerCase().includes(t) || e.category.toLowerCase().includes(t) || e.address.toLowerCase().includes(t));
62
66
  }
63
- switch (F.status && (F.status === "active" && (e = e.filter((e) => e.isActive)), F.status === "inactive" && (e = e.filter((e) => !e.isActive))), F.verificationStatus && (F.verificationStatus === "verified" && (e = e.filter((e) => e.isVerified)), F.verificationStatus === "pending" && (e = e.filter((e) => !e.isVerified && e.inspectionStatus !== "failed")), F.verificationStatus === "rejected" && (e = e.filter((e) => e.inspectionStatus === "failed"))), F.category && (e = e.filter((e) => e.category === F.category)), F.location && (e = e.filter((e) => e.city.toLowerCase().includes(F.location.toLowerCase()))), F.sortBy) {
67
+ switch (N) {
64
68
  case "name":
65
69
  e.sort((e, t) => e.name.localeCompare(t.name));
66
70
  break;
67
71
  case "rating":
68
72
  e.sort((e, t) => t.rating - e.rating);
69
73
  break;
70
- case "revenue":
71
- e.sort((e, t) => t.monthlyRevenue - e.monthlyRevenue);
74
+ case "value":
75
+ e.sort((e, t) => t.avgOrderValue - e.avgOrderValue);
72
76
  break;
73
- case "compliance":
74
- e.sort((e, t) => t.complianceScore - e.complianceScore);
75
- break;
76
- default: e.sort((e, t) => new Date(t.applicationDate).getTime() - new Date(e.applicationDate).getTime());
77
+ default: e.sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime());
77
78
  }
78
79
  return e;
79
- }, [L, F]), B = (e, t) => {
80
- I((n) => ({
81
- ...n,
82
- [e]: t
83
- }));
84
- }, V = (e, t) => {
85
- O(e), M(t), P(""), A(!0);
86
- }, H = () => {
87
- if (!D) return;
88
- let e = "";
89
- switch (j) {
90
- case "approve":
91
- e = `Cart "${D.name}" approved successfully`;
92
- break;
93
- case "reject":
94
- if (!N.trim()) {
95
- alert("Please provide a rejection reason");
96
- return;
97
- }
98
- e = `Cart "${D.name}" rejected`;
99
- break;
100
- case "suspend":
101
- e = `Cart "${D.name}" suspended`;
102
- break;
103
- case "inspect":
104
- e = `Inspection scheduled for "${D.name}"`;
105
- break;
106
- }
107
- alert(e), A(!1), P("");
108
- }, U = (e) => new Date(e).toLocaleDateString("en-IN", {
80
+ }, [
81
+ G,
82
+ D,
83
+ j,
84
+ k,
85
+ N
86
+ ]), Y = (e) => te(e, { minimumFractionDigits: 0 }), ue = (e) => new Date(e).toLocaleDateString("en-IN", {
109
87
  year: "numeric",
110
88
  month: "short",
111
89
  day: "numeric"
112
- }), W = (e) => e.isVerified ? /* @__PURE__ */ y("span", {
113
- className: "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium bg-status-success-bg-subtle text-status-success-text",
114
- children: "Verified"
115
- }) : e.inspectionStatus === "pending" ? /* @__PURE__ */ y("span", {
116
- className: "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium bg-status-warning-bg-subtle text-status-warning-text",
117
- children: "Pending Review"
118
- }) : e.inspectionStatus === "scheduled" ? /* @__PURE__ */ y("span", {
119
- className: "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium bg-[var(--color-accent-soft)] text-text-primary",
120
- children: "Inspection Scheduled"
121
- }) : e.inspectionStatus === "failed" ? /* @__PURE__ */ y("span", {
122
- className: "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium bg-status-error-bg-subtle text-status-error-text",
123
- children: "Rejected"
124
- }) : /* @__PURE__ */ y("span", {
125
- className: "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium bg-bg-sunken text-text-secondary",
126
- children: "Under Review"
127
- }), G = (e) => e ? /* @__PURE__ */ y("span", {
128
- className: "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium bg-status-success-bg-subtle text-status-success-text",
129
- children: "Active"
130
- }) : /* @__PURE__ */ y("span", {
131
- className: "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium bg-bg-sunken text-text-secondary",
132
- children: "Inactive"
133
- }), K = (e) => /* @__PURE__ */ y("div", {
134
- className: "w-full bg-bg-sunken rounded-full h-2",
135
- children: /* @__PURE__ */ y("div", {
136
- className: t("h-2 rounded-full", e >= 80 ? "bg-status-success-text" : e >= 60 ? "bg-status-warning-text" : "bg-status-error-text"),
137
- style: { width: `${e}%` }
138
- })
90
+ }), X = (e, t) => {
91
+ R(e), B(t), W(""), H(!0);
92
+ }, de = () => {
93
+ if (!L) return;
94
+ if (z === "reject" && !U.trim()) {
95
+ E("Please provide a rejection reason", "error");
96
+ return;
97
+ }
98
+ let e = z === "approve" ? "VERIFIED" : z === "reject" ? "ARCHIVED" : "SUSPENDED";
99
+ C.mutate({
100
+ id: L.id,
101
+ input: { status: e }
102
+ }, {
103
+ onSuccess: () => {
104
+ let e = z === "approve" ? "approved & verified" : z === "reject" ? "rejected" : "suspended";
105
+ E(`"${L.name}" ${e}.`, "success"), H(!1), W("");
106
+ },
107
+ onError: () => E(`Could not ${z} "${L.name}". Please try again.`, "error")
108
+ });
109
+ }, Z = ({ status: t }) => /* @__PURE__ */ v("span", {
110
+ className: e("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium", x[t].cls),
111
+ children: x[t].label
112
+ }), Q = ({ m: t, compact: n }) => /* @__PURE__ */ y("div", {
113
+ className: e("flex gap-2", n ? "flex-wrap" : "items-center justify-end"),
114
+ children: [!t.isVerified && /* @__PURE__ */ v("button", {
115
+ type: "button",
116
+ onClick: () => X(t, "approve"),
117
+ className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
118
+ children: "Approve"
119
+ }), t.status !== "inactive" && /* @__PURE__ */ v("button", {
120
+ type: "button",
121
+ onClick: () => X(t, "suspend"),
122
+ className: "rounded-lg border border-border-default px-3 py-1.5 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
123
+ children: "Suspend"
124
+ })]
125
+ }), $ = ({ m: e }) => /* @__PURE__ */ y("div", {
126
+ className: "rounded-lg border border-border-subtle bg-bg-sunken/40 p-4",
127
+ children: [/* @__PURE__ */ y("div", {
128
+ className: "grid grid-cols-1 gap-6 md:grid-cols-2",
129
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h4", {
130
+ className: "mb-3 text-sm font-semibold text-text-primary",
131
+ children: "Business Details"
132
+ }), /* @__PURE__ */ y("dl", {
133
+ className: "space-y-2 text-sm",
134
+ children: [
135
+ /* @__PURE__ */ y("div", {
136
+ className: "flex gap-2",
137
+ children: [/* @__PURE__ */ v("dt", {
138
+ className: "w-28 shrink-0 text-text-secondary",
139
+ children: "Merchant"
140
+ }), /* @__PURE__ */ v("dd", {
141
+ className: "font-medium text-text-primary",
142
+ children: e.name
143
+ })]
144
+ }),
145
+ /* @__PURE__ */ y("div", {
146
+ className: "flex gap-2",
147
+ children: [/* @__PURE__ */ v("dt", {
148
+ className: "w-28 shrink-0 text-text-secondary",
149
+ children: "Category"
150
+ }), /* @__PURE__ */ v("dd", {
151
+ className: "text-text-primary",
152
+ children: b(e.category)
153
+ })]
154
+ }),
155
+ e.address && /* @__PURE__ */ y("div", {
156
+ className: "flex gap-2",
157
+ children: [/* @__PURE__ */ v("dt", {
158
+ className: "w-28 shrink-0 text-text-secondary",
159
+ children: "Address"
160
+ }), /* @__PURE__ */ y("dd", {
161
+ className: "flex items-start gap-1 text-text-primary",
162
+ children: [/* @__PURE__ */ v(ie, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-text-secondary" }), e.address]
163
+ })]
164
+ }),
165
+ /* @__PURE__ */ y("div", {
166
+ className: "flex gap-2",
167
+ children: [/* @__PURE__ */ v("dt", {
168
+ className: "w-28 shrink-0 text-text-secondary",
169
+ children: "Applied"
170
+ }), /* @__PURE__ */ y("dd", {
171
+ className: "flex items-center gap-1 text-text-primary",
172
+ children: [/* @__PURE__ */ v(u, { className: "h-3.5 w-3.5 text-text-secondary" }), ue(e.createdAt)]
173
+ })]
174
+ }),
175
+ e.ownerId && /* @__PURE__ */ y("div", {
176
+ className: "flex gap-2",
177
+ children: [/* @__PURE__ */ v("dt", {
178
+ className: "w-28 shrink-0 text-text-secondary",
179
+ children: "Owner ID"
180
+ }), /* @__PURE__ */ v("dd", {
181
+ className: "truncate font-mono text-xs text-text-primary",
182
+ children: e.ownerId
183
+ })]
184
+ })
185
+ ]
186
+ })] }), /* @__PURE__ */ y("div", { children: [
187
+ /* @__PURE__ */ v("h4", {
188
+ className: "mb-3 text-sm font-semibold text-text-primary",
189
+ children: "Performance"
190
+ }),
191
+ /* @__PURE__ */ y("div", {
192
+ className: "grid grid-cols-2 gap-3",
193
+ children: [/* @__PURE__ */ y("div", {
194
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
195
+ children: [
196
+ /* @__PURE__ */ v("p", {
197
+ className: "text-xs text-text-secondary",
198
+ children: "Rating"
199
+ }),
200
+ /* @__PURE__ */ y("p", {
201
+ className: "flex items-center gap-1 text-lg font-bold text-text-primary",
202
+ children: [/* @__PURE__ */ v(h, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" }), e.rating > 0 ? e.rating.toFixed(1) : "—"]
203
+ }),
204
+ /* @__PURE__ */ y("p", {
205
+ className: "text-xs text-text-secondary",
206
+ children: [e.reviewCount, " reviews"]
207
+ })
208
+ ]
209
+ }), /* @__PURE__ */ y("div", {
210
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
211
+ children: [/* @__PURE__ */ v("p", {
212
+ className: "text-xs text-text-secondary",
213
+ children: "Avg Order Value"
214
+ }), /* @__PURE__ */ y("p", {
215
+ className: "flex items-center gap-0.5 text-lg font-bold text-text-primary",
216
+ children: [/* @__PURE__ */ v(p, { className: "h-3.5 w-3.5" }), e.avgOrderValue > 0 ? e.avgOrderValue.toLocaleString("en-IN") : "—"]
217
+ })]
218
+ })]
219
+ }),
220
+ e.serviceTypes.length > 0 && /* @__PURE__ */ v("div", {
221
+ className: "mt-3 flex flex-wrap gap-1.5",
222
+ children: e.serviceTypes.map((e) => /* @__PURE__ */ v("span", {
223
+ className: "rounded-full bg-bg-surface px-2 py-0.5 text-xs text-text-secondary",
224
+ children: b(e)
225
+ }, e))
226
+ })
227
+ ] })]
228
+ }), /* @__PURE__ */ y("div", {
229
+ className: "mt-4 flex flex-col items-start justify-between gap-3 border-t border-border-subtle pt-4 sm:flex-row sm:items-center",
230
+ children: [/* @__PURE__ */ y("p", {
231
+ className: "flex items-center gap-1.5 text-xs text-text-muted",
232
+ children: [/* @__PURE__ */ v(ne, { className: "h-3.5 w-3.5" }), "Verification documents are not stored on the platform yet."]
233
+ }), /* @__PURE__ */ y("div", {
234
+ className: "flex flex-wrap gap-2",
235
+ children: [
236
+ !e.isVerified && /* @__PURE__ */ v("button", {
237
+ type: "button",
238
+ onClick: () => X(e, "reject"),
239
+ className: "rounded-lg border border-status-error-text/40 px-3 py-1.5 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
240
+ children: "Reject"
241
+ }),
242
+ !e.isVerified && /* @__PURE__ */ v("button", {
243
+ type: "button",
244
+ onClick: () => X(e, "approve"),
245
+ className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
246
+ children: "Approve Merchant"
247
+ }),
248
+ e.status !== "inactive" && /* @__PURE__ */ v("button", {
249
+ type: "button",
250
+ onClick: () => X(e, "suspend"),
251
+ className: "rounded-lg border border-border-default px-3 py-1.5 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
252
+ children: "Suspend"
253
+ })
254
+ ]
255
+ })]
256
+ })]
139
257
  });
140
- return E ? /* @__PURE__ */ y(n, {
141
- title: "Cart Management",
142
- description: "Loading carts...",
143
- children: /* @__PURE__ */ b("div", {
258
+ return ce ? /* @__PURE__ */ v(t, {
259
+ title: "Merchants",
260
+ description: "Loading merchants...",
261
+ children: /* @__PURE__ */ y("div", {
144
262
  className: "flex flex-col items-center justify-center py-20",
145
- children: [/* @__PURE__ */ y(d, { className: "h-10 w-10 animate-spin text-text-secondary mb-4" }), /* @__PURE__ */ y("p", {
263
+ children: [/* @__PURE__ */ v(re, { className: "mb-4 h-10 w-10 animate-spin text-text-secondary" }), /* @__PURE__ */ v("p", {
146
264
  className: "text-text-secondary",
147
- children: "Loading carts..."
265
+ children: "Loading merchants..."
148
266
  })]
149
267
  })
150
- }) : /* @__PURE__ */ b(n, {
151
- title: "Cart Management",
152
- description: `${R.totalCarts} service providers on the platform`,
153
- actions: /* @__PURE__ */ b("span", {
154
- className: "text-sm text-text-secondary",
155
- children: [R.pendingApproval, " pending approval"]
156
- }),
268
+ }) : /* @__PURE__ */ y(t, {
269
+ title: "Merchants",
270
+ description: `${K.all} merchants on the platform · ${K.pending} awaiting review`,
157
271
  children: [
158
- /* @__PURE__ */ y(S, {
272
+ /* @__PURE__ */ v(oe, {
159
273
  className: "mb-6",
160
- children: "Where you onboard and oversee every cart (service provider) on Kadaikodi. Use this page to approve or reject new applications, verify legitimate businesses, suspend ones that break the rules, and keep an eye on each cart's performance and ratings — so customers only ever see trustworthy, active providers. Filter and search to zero in on what needs your attention."
274
+ children: "Onboard and oversee every merchant (cart) on Kadaikodi. Approve and verify legitimate businesses, suspend ones that break the rules, and keep an eye on ratings and performance — so customers only ever see trustworthy, active merchants."
161
275
  }),
162
- /* @__PURE__ */ b(x, {
163
- className: "mb-6",
164
- children: [/* @__PURE__ */ y("h2", {
165
- className: "mb-4 text-lg font-semibold text-text-primary",
166
- children: "Provider Overview"
167
- }), /* @__PURE__ */ y("div", {
168
- className: "grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-8 gap-3",
169
- children: [
170
- {
171
- label: "Total Carts",
172
- value: R.totalCarts,
173
- cls: ""
174
- },
175
- {
176
- label: "Active",
177
- value: R.activeCarts,
178
- cls: "bg-status-success-bg-subtle border-status-success-text/30"
179
- },
180
- {
181
- label: "Pending",
182
- value: R.pendingApproval,
183
- cls: "bg-status-warning-bg-subtle border-status-warning-text/30"
184
- },
185
- {
186
- label: "Rejected",
187
- value: R.rejectedCarts,
188
- cls: "bg-status-error-bg-subtle border-status-error-text/30"
189
- },
190
- {
191
- label: "Total Revenue",
192
- value: a(R.totalRevenue, { minimumFractionDigits: 0 }),
193
- cls: "col-span-2 min-w-fit"
194
- },
195
- {
196
- label: "Avg Rating",
197
- value: `${R.averageRating}`,
198
- cls: ""
199
- },
200
- {
201
- label: "New Apps",
202
- value: R.newApplications,
203
- cls: "bg-[var(--color-accent-soft)] border-border-focus/30"
204
- }
205
- ].map((e) => /* @__PURE__ */ b("div", {
206
- className: t("rounded-lg border border-border-subtle bg-bg-surface p-3", e.cls),
207
- children: [/* @__PURE__ */ y("p", {
208
- className: "text-xs text-text-secondary",
209
- children: e.label
210
- }), /* @__PURE__ */ y("p", {
211
- className: "text-lg font-bold text-text-primary",
212
- children: e.value
213
- })]
214
- }, e.label))
276
+ w && /* @__PURE__ */ y("div", {
277
+ className: e("mb-6 flex items-center gap-2 rounded-lg border p-3", w.type === "success" ? "border-status-success-text/30 bg-status-success-bg-subtle" : "border-status-error-text/30 bg-status-error-bg-subtle"),
278
+ children: [w.type === "success" ? /* @__PURE__ */ v(d, { className: "h-4 w-4 text-status-success-text" }) : /* @__PURE__ */ v(l, { className: "h-4 w-4 text-status-error-text" }), /* @__PURE__ */ v("span", {
279
+ className: e("text-sm font-medium", w.type === "success" ? "text-status-success-text" : "text-status-error-text"),
280
+ children: w.text
215
281
  })]
216
282
  }),
217
283
  /* @__PURE__ */ y("div", {
218
- className: "rounded-lg border border-border-subtle bg-bg-surface p-4 mb-6",
219
- children: /* @__PURE__ */ b("div", {
220
- className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",
284
+ className: "mb-6 grid grid-cols-2 gap-4 lg:grid-cols-4",
285
+ children: [
286
+ /* @__PURE__ */ v(i, {
287
+ label: "Total Merchants",
288
+ value: K.all.toLocaleString("en-IN"),
289
+ icon: /* @__PURE__ */ v(g, { className: "h-4 w-4" })
290
+ }),
291
+ /* @__PURE__ */ v(i, {
292
+ label: "Pending Review",
293
+ value: K.pending.toLocaleString("en-IN"),
294
+ icon: /* @__PURE__ */ v(l, { className: "h-4 w-4" })
295
+ }),
296
+ /* @__PURE__ */ v(i, {
297
+ label: "Verified",
298
+ value: K.verified.toLocaleString("en-IN"),
299
+ icon: /* @__PURE__ */ v(d, { className: "h-4 w-4" })
300
+ }),
301
+ /* @__PURE__ */ v(i, {
302
+ label: "Avg Rating",
303
+ value: q > 0 ? q.toFixed(1) : "—",
304
+ icon: /* @__PURE__ */ v(h, { className: "h-4 w-4" })
305
+ })
306
+ ]
307
+ }),
308
+ /* @__PURE__ */ y("div", {
309
+ className: "mb-6 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",
310
+ children: [/* @__PURE__ */ v("div", {
311
+ className: "overflow-x-auto",
312
+ children: /* @__PURE__ */ v(a, {
313
+ "aria-label": "Filter merchants by status",
314
+ value: D,
315
+ onChange: (e) => O(e),
316
+ tabs: [
317
+ {
318
+ id: "all",
319
+ label: "All",
320
+ count: K.all
321
+ },
322
+ {
323
+ id: "pending",
324
+ label: "Pending",
325
+ count: K.pending
326
+ },
327
+ {
328
+ id: "verified",
329
+ label: "Verified",
330
+ count: K.verified
331
+ },
332
+ {
333
+ id: "inactive",
334
+ label: "Inactive",
335
+ count: K.inactive
336
+ }
337
+ ]
338
+ })
339
+ }), /* @__PURE__ */ y("div", {
340
+ className: "flex flex-col gap-3 sm:flex-row",
221
341
  children: [
222
- /* @__PURE__ */ b("div", {
342
+ /* @__PURE__ */ y("div", {
223
343
  className: "relative",
224
- children: [/* @__PURE__ */ y(p, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ y("input", {
344
+ children: [/* @__PURE__ */ v(m, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ v("input", {
225
345
  type: "text",
226
- placeholder: "Search carts...",
227
- value: F.searchQuery,
228
- onChange: (e) => B("searchQuery", e.target.value),
229
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface py-2 pl-10 pr-4 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
346
+ placeholder: "Search merchants...",
347
+ value: k,
348
+ onChange: (e) => A(e.target.value),
349
+ className: "w-full rounded-lg border border-border-subtle bg-bg-surface py-2 pl-10 pr-4 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] sm:w-64"
230
350
  })]
231
351
  }),
232
- /* @__PURE__ */ b("select", {
233
- value: F.status,
234
- onChange: (e) => B("status", e.target.value),
235
- className: "rounded-lg border border-border-subtle bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
236
- children: [
237
- /* @__PURE__ */ y("option", {
238
- value: "",
239
- children: "All Status"
240
- }),
241
- /* @__PURE__ */ y("option", {
242
- value: "active",
243
- children: "Active"
244
- }),
245
- /* @__PURE__ */ y("option", {
246
- value: "inactive",
247
- children: "Inactive"
248
- })
249
- ]
250
- }),
251
- /* @__PURE__ */ b("select", {
252
- value: F.verificationStatus,
253
- onChange: (e) => B("verificationStatus", e.target.value),
254
- className: "rounded-lg border border-border-subtle bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
255
- children: [
256
- /* @__PURE__ */ y("option", {
257
- value: "",
258
- children: "All Verification"
259
- }),
260
- /* @__PURE__ */ y("option", {
261
- value: "verified",
262
- children: "Verified"
263
- }),
264
- /* @__PURE__ */ y("option", {
265
- value: "pending",
266
- children: "Pending"
267
- }),
268
- /* @__PURE__ */ y("option", {
269
- value: "rejected",
270
- children: "Rejected"
271
- })
272
- ]
352
+ /* @__PURE__ */ y("select", {
353
+ value: j,
354
+ onChange: (e) => M(e.target.value),
355
+ className: "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)]",
356
+ children: [/* @__PURE__ */ v("option", {
357
+ value: "",
358
+ children: "All Categories"
359
+ }), le.map((e) => /* @__PURE__ */ v("option", {
360
+ value: e,
361
+ children: b(e)
362
+ }, e))]
273
363
  }),
274
- /* @__PURE__ */ b("select", {
275
- value: F.category,
276
- onChange: (e) => B("category", e.target.value),
277
- className: "rounded-lg border border-border-subtle bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
364
+ /* @__PURE__ */ y("select", {
365
+ value: N,
366
+ onChange: (e) => P(e.target.value),
367
+ className: "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)]",
278
368
  children: [
279
- /* @__PURE__ */ y("option", {
280
- value: "",
281
- children: "All Categories"
282
- }),
283
- /* @__PURE__ */ y("option", {
284
- value: "Food & Beverage",
285
- children: "Food & Beverage"
286
- }),
287
- /* @__PURE__ */ y("option", {
288
- value: "Beverages",
289
- children: "Beverages"
290
- }),
291
- /* @__PURE__ */ y("option", {
292
- value: "Street Food",
293
- children: "Street Food"
294
- }),
295
- /* @__PURE__ */ y("option", {
296
- value: "Fast Food",
297
- children: "Fast Food"
298
- })
299
- ]
300
- }),
301
- /* @__PURE__ */ y("input", {
302
- type: "text",
303
- placeholder: "Location...",
304
- value: F.location,
305
- onChange: (e) => B("location", e.target.value),
306
- className: "rounded-lg border border-border-subtle bg-bg-surface py-2 px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
307
- }),
308
- /* @__PURE__ */ b("select", {
309
- value: F.sortBy,
310
- onChange: (e) => B("sortBy", e.target.value),
311
- className: "rounded-lg border border-border-subtle bg-bg-surface py-2 px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
312
- children: [
313
- /* @__PURE__ */ y("option", {
369
+ /* @__PURE__ */ v("option", {
314
370
  value: "recent",
315
371
  children: "Most Recent"
316
372
  }),
317
- /* @__PURE__ */ y("option", {
373
+ /* @__PURE__ */ v("option", {
318
374
  value: "name",
319
- children: "Name A-Z"
375
+ children: "Name A–Z"
320
376
  }),
321
- /* @__PURE__ */ y("option", {
377
+ /* @__PURE__ */ v("option", {
322
378
  value: "rating",
323
379
  children: "Highest Rated"
324
380
  }),
325
- /* @__PURE__ */ y("option", {
326
- value: "revenue",
327
- children: "Highest Revenue"
328
- }),
329
- /* @__PURE__ */ y("option", {
330
- value: "compliance",
331
- children: "Best Compliance"
381
+ /* @__PURE__ */ v("option", {
382
+ value: "value",
383
+ children: "Highest Avg Order"
332
384
  })
333
385
  ]
334
386
  })
335
387
  ]
336
- })
388
+ })]
337
389
  }),
338
- /* @__PURE__ */ b("div", {
339
- className: "rounded-lg border border-border-subtle bg-bg-surface overflow-hidden",
340
- children: [
341
- /* @__PURE__ */ y("div", {
342
- className: "block md:hidden space-y-4 p-4",
343
- children: z.map((e) => /* @__PURE__ */ b("div", {
344
- className: "rounded-lg border border-border-subtle bg-bg-sunken/30 p-4",
390
+ J.length === 0 ? /* @__PURE__ */ v(n, {
391
+ illustration: "empty-search",
392
+ title: "No merchants found",
393
+ description: "No merchants match your current filters. Try clearing the search or switching tabs.",
394
+ action: /* @__PURE__ */ v("button", {
395
+ type: "button",
396
+ onClick: () => {
397
+ A(""), M(""), O("all");
398
+ },
399
+ className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
400
+ children: "Clear filters"
401
+ })
402
+ }) : /* @__PURE__ */ y(ae, {
403
+ treatment: "plain",
404
+ className: "overflow-hidden",
405
+ children: [/* @__PURE__ */ v("div", {
406
+ className: "hidden overflow-x-auto md:block",
407
+ children: /* @__PURE__ */ y("table", {
408
+ className: "w-full",
409
+ children: [/* @__PURE__ */ v("thead", { children: /* @__PURE__ */ y("tr", {
410
+ className: "border-b border-border-subtle bg-bg-sunken/50",
345
411
  children: [
346
- /* @__PURE__ */ b("div", {
347
- className: "flex items-center mb-3",
348
- children: [/* @__PURE__ */ y("div", {
349
- className: "w-16 h-16 rounded-lg bg-bg-sunken flex items-center justify-center mr-3 shrink-0",
350
- children: /* @__PURE__ */ y(h, { className: "h-7 w-7 text-text-secondary" })
351
- }), /* @__PURE__ */ b("div", {
352
- className: "flex-1 min-w-0",
353
- children: [
354
- /* @__PURE__ */ y("h3", {
355
- className: "font-medium text-text-primary text-lg truncate",
356
- children: e.name
357
- }),
358
- /* @__PURE__ */ y("p", {
359
- className: "text-sm text-text-secondary truncate",
360
- children: e.category
361
- }),
362
- /* @__PURE__ */ y("p", {
363
- className: "text-sm text-text-secondary truncate",
364
- children: e.address
365
- })
366
- ]
367
- })]
412
+ /* @__PURE__ */ v("th", {
413
+ className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
414
+ children: "Merchant"
368
415
  }),
369
- /* @__PURE__ */ b("div", {
370
- className: "grid grid-cols-2 gap-4 mb-3 text-sm",
371
- children: [/* @__PURE__ */ b("div", { children: [
372
- /* @__PURE__ */ y("p", {
373
- className: "text-text-secondary font-medium",
374
- children: "Owner"
375
- }),
376
- /* @__PURE__ */ y("p", {
377
- className: "text-text-primary",
378
- children: e.ownerName
379
- }),
380
- /* @__PURE__ */ y("p", {
381
- className: "text-text-secondary text-xs",
382
- children: e.ownerPhone
383
- })
384
- ] }), /* @__PURE__ */ b("div", { children: [
385
- /* @__PURE__ */ y("p", {
386
- className: "text-text-secondary font-medium",
387
- children: "Performance"
388
- }),
389
- /* @__PURE__ */ b("p", {
390
- className: "text-text-primary",
391
- children: [a(e.monthlyRevenue, { minimumFractionDigits: 0 }), "/mo"]
392
- }),
393
- /* @__PURE__ */ b("p", {
394
- className: "text-text-secondary text-xs",
395
- children: [e.monthlyOrders, " orders"]
396
- })
397
- ] })]
416
+ /* @__PURE__ */ v("th", {
417
+ className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
418
+ children: "Category"
398
419
  }),
399
- /* @__PURE__ */ b("div", {
400
- className: "flex flex-wrap gap-2 mb-3",
401
- children: [
402
- G(e.isActive),
403
- W(e),
404
- e.rating > 0 && /* @__PURE__ */ b("span", {
405
- className: "inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium bg-status-warning-bg-subtle text-status-warning-text",
406
- children: [
407
- /* @__PURE__ */ y(m, { className: "h-3 w-3 fill-current" }),
408
- e.rating,
409
- " (",
410
- e.reviewCount,
411
- ")"
412
- ]
413
- })
414
- ]
420
+ /* @__PURE__ */ v("th", {
421
+ className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
422
+ children: "Status"
415
423
  }),
416
- /* @__PURE__ */ b("div", {
417
- className: "mb-3",
418
- children: [
419
- /* @__PURE__ */ b("div", {
420
- className: "flex items-center justify-between text-sm mb-1",
421
- children: [/* @__PURE__ */ y("span", {
422
- className: "text-text-secondary",
423
- children: "Compliance"
424
- }), /* @__PURE__ */ b("span", {
425
- className: "font-medium text-text-primary",
426
- children: [e.complianceScore, "%"]
427
- })]
428
- }),
429
- K(e.complianceScore),
430
- /* @__PURE__ */ b("p", {
431
- className: "text-xs text-text-secondary mt-1",
432
- children: [
433
- "Docs: ",
434
- e.documentsSubmitted,
435
- "/",
436
- e.documentsRequired,
437
- " • Applied:",
438
- " ",
439
- U(e.applicationDate)
440
- ]
441
- })
442
- ]
424
+ /* @__PURE__ */ v("th", {
425
+ className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
426
+ children: "Rating"
443
427
  }),
444
- /* @__PURE__ */ b("div", {
445
- className: "flex flex-wrap gap-2",
446
- children: [
447
- /* @__PURE__ */ y("button", {
448
- type: "button",
449
- onClick: () => V(e, "view"),
450
- className: "flex-1 rounded-lg border border-border-subtle px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
451
- children: "View Details"
452
- }),
453
- !e.isVerified && e.inspectionStatus !== "failed" && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("button", {
454
- type: "button",
455
- onClick: () => V(e, "approve"),
456
- className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
457
- children: "Approve"
458
- }), /* @__PURE__ */ y("button", {
459
- type: "button",
460
- onClick: () => V(e, "reject"),
461
- className: "rounded-lg border border-border-subtle px-3 py-1.5 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle transition-colors",
462
- children: "Reject"
463
- })] }),
464
- e.inspectionStatus === "pending" && /* @__PURE__ */ y("button", {
465
- type: "button",
466
- onClick: () => V(e, "inspect"),
467
- className: "rounded-lg border border-border-subtle px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
468
- children: "Inspect"
469
- }),
470
- e.isActive && /* @__PURE__ */ y("button", {
471
- type: "button",
472
- onClick: () => V(e, "suspend"),
473
- className: "rounded-lg border border-border-subtle px-3 py-1.5 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle transition-colors",
474
- children: "Suspend"
475
- })
476
- ]
428
+ /* @__PURE__ */ v("th", {
429
+ className: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-text-secondary",
430
+ children: "Avg Order"
431
+ }),
432
+ /* @__PURE__ */ v("th", {
433
+ className: "px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-text-secondary",
434
+ children: "Actions"
477
435
  })
478
436
  ]
479
- }, e.id))
480
- }),
481
- /* @__PURE__ */ y("div", {
482
- className: "hidden md:block overflow-x-auto",
483
- children: /* @__PURE__ */ b("table", {
484
- className: "w-full",
485
- children: [/* @__PURE__ */ y("thead", { children: /* @__PURE__ */ b("tr", {
486
- className: "border-b border-border-subtle bg-bg-sunken/50",
487
- children: [
488
- /* @__PURE__ */ y("th", {
489
- className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
490
- children: "Cart"
491
- }),
492
- /* @__PURE__ */ y("th", {
493
- className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
494
- children: "Owner"
495
- }),
496
- /* @__PURE__ */ y("th", {
497
- className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
498
- children: "Status"
499
- }),
500
- /* @__PURE__ */ y("th", {
501
- className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
502
- children: "Performance"
503
- }),
504
- /* @__PURE__ */ y("th", {
505
- className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
506
- children: "Compliance"
507
- }),
508
- /* @__PURE__ */ y("th", {
509
- className: "px-4 py-3 text-left text-xs font-medium text-text-secondary uppercase tracking-wider",
510
- children: "Actions"
511
- })
512
- ]
513
- }) }), /* @__PURE__ */ y("tbody", {
514
- className: "divide-y divide-border",
515
- children: z.map((e) => /* @__PURE__ */ b("tr", {
516
- className: "hover:bg-accent/50 transition-colors",
437
+ }) }), /* @__PURE__ */ v("tbody", {
438
+ className: "divide-y divide-border",
439
+ children: J.map((t) => {
440
+ let n = F === t.id;
441
+ return /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ y("tr", {
442
+ className: "transition-colors hover:bg-accent/50",
517
443
  children: [
518
- /* @__PURE__ */ y("td", {
444
+ /* @__PURE__ */ v("td", {
519
445
  className: "px-4 py-3",
520
- children: /* @__PURE__ */ b("div", {
521
- className: "flex items-center gap-3",
522
- children: [/* @__PURE__ */ y("div", {
523
- className: "w-12 h-12 rounded-lg bg-bg-sunken flex items-center justify-center shrink-0",
524
- children: /* @__PURE__ */ y(h, { className: "h-5 w-5 text-text-secondary" })
525
- }), /* @__PURE__ */ b("div", {
526
- className: "min-w-0",
527
- children: [
528
- /* @__PURE__ */ y("p", {
529
- className: "text-sm font-medium text-text-primary truncate",
530
- children: e.name
531
- }),
532
- /* @__PURE__ */ y("p", {
533
- className: "text-xs text-text-secondary truncate",
534
- children: e.category
535
- }),
536
- /* @__PURE__ */ y("p", {
537
- className: "text-xs text-text-secondary truncate",
538
- children: e.address
539
- })
540
- ]
541
- })]
446
+ children: /* @__PURE__ */ y("button", {
447
+ type: "button",
448
+ onClick: () => I(n ? null : t.id),
449
+ className: "flex items-center gap-3 text-left",
450
+ children: [
451
+ /* @__PURE__ */ v(f, { className: e("h-4 w-4 shrink-0 text-text-secondary transition-transform", n && "rotate-180") }),
452
+ /* @__PURE__ */ v("div", {
453
+ className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
454
+ children: /* @__PURE__ */ v(g, { className: "h-5 w-5" })
455
+ }),
456
+ /* @__PURE__ */ y("div", {
457
+ className: "min-w-0",
458
+ children: [/* @__PURE__ */ v("p", {
459
+ className: "truncate text-sm font-medium text-text-primary",
460
+ children: t.name
461
+ }), t.address && /* @__PURE__ */ v("p", {
462
+ className: "truncate text-xs text-text-secondary",
463
+ children: t.address
464
+ })]
465
+ })
466
+ ]
542
467
  })
543
468
  }),
544
- /* @__PURE__ */ b("td", {
545
- className: "px-4 py-3 text-sm",
546
- children: [
547
- /* @__PURE__ */ y("p", {
548
- className: "font-medium text-text-primary",
549
- children: e.ownerName
550
- }),
551
- /* @__PURE__ */ y("p", {
552
- className: "text-xs text-text-secondary",
553
- children: e.ownerEmail
554
- }),
555
- /* @__PURE__ */ y("p", {
556
- className: "text-xs text-text-secondary",
557
- children: e.ownerPhone
558
- })
559
- ]
469
+ /* @__PURE__ */ v("td", {
470
+ className: "px-4 py-3 text-sm text-text-secondary",
471
+ children: b(t.category)
560
472
  }),
561
- /* @__PURE__ */ y("td", {
473
+ /* @__PURE__ */ v("td", {
562
474
  className: "px-4 py-3",
563
- children: /* @__PURE__ */ b("div", {
564
- className: "space-y-1",
475
+ children: /* @__PURE__ */ v(Z, { status: t.status })
476
+ }),
477
+ /* @__PURE__ */ v("td", {
478
+ className: "px-4 py-3 text-sm",
479
+ children: t.rating > 0 ? /* @__PURE__ */ y("span", {
480
+ className: "flex items-center gap-1 text-text-primary",
565
481
  children: [
566
- G(e.isActive),
567
- /* @__PURE__ */ y("br", {}),
568
- W(e),
569
- e.rating > 0 && /* @__PURE__ */ b("div", {
570
- className: "text-sm flex items-center gap-1 mt-1",
482
+ /* @__PURE__ */ v(h, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" }),
483
+ t.rating.toFixed(1),
484
+ /* @__PURE__ */ y("span", {
485
+ className: "text-text-secondary",
571
486
  children: [
572
- /* @__PURE__ */ y(m, { className: "h-3 w-3 fill-status-warning-text text-status-warning-text" }),
573
- e.rating,
574
- " ",
575
- /* @__PURE__ */ b("span", {
576
- className: "text-text-secondary",
577
- children: [
578
- "(",
579
- e.reviewCount,
580
- ")"
581
- ]
582
- })
487
+ "(",
488
+ t.reviewCount,
489
+ ")"
583
490
  ]
584
491
  })
585
492
  ]
493
+ }) : /* @__PURE__ */ v("span", {
494
+ className: "text-text-secondary",
495
+ children: "—"
586
496
  })
587
497
  }),
588
- /* @__PURE__ */ b("td", {
589
- className: "px-4 py-3 text-sm",
590
- children: [/* @__PURE__ */ b("p", {
591
- className: "text-text-primary",
592
- children: [a(e.monthlyRevenue, { minimumFractionDigits: 0 }), "/mo"]
593
- }), /* @__PURE__ */ b("p", {
594
- className: "text-text-secondary",
595
- children: [e.monthlyOrders, " orders/mo"]
596
- })]
498
+ /* @__PURE__ */ v("td", {
499
+ className: "px-4 py-3 text-sm text-text-primary",
500
+ children: t.avgOrderValue > 0 ? Y(t.avgOrderValue) : "—"
597
501
  }),
598
- /* @__PURE__ */ b("td", {
599
- className: "px-4 py-3 text-sm",
502
+ /* @__PURE__ */ v("td", {
503
+ className: "px-4 py-3",
504
+ children: /* @__PURE__ */ v(Q, { m: t })
505
+ })
506
+ ]
507
+ }), n && /* @__PURE__ */ v("tr", {
508
+ className: "bg-bg-sunken/20",
509
+ children: /* @__PURE__ */ v("td", {
510
+ colSpan: 6,
511
+ className: "px-4 py-4",
512
+ children: /* @__PURE__ */ v($, { m: t })
513
+ })
514
+ })] }, t.id);
515
+ })
516
+ })]
517
+ })
518
+ }), /* @__PURE__ */ v("div", {
519
+ className: "space-y-4 p-4 md:hidden",
520
+ children: J.map((t) => {
521
+ let n = F === t.id;
522
+ return /* @__PURE__ */ y("div", {
523
+ className: "rounded-lg border border-border-subtle bg-bg-sunken/30 p-4",
524
+ children: [
525
+ /* @__PURE__ */ y("div", {
526
+ className: "mb-3 flex items-start gap-3",
527
+ children: [/* @__PURE__ */ v("div", {
528
+ className: "flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
529
+ children: /* @__PURE__ */ v(g, { className: "h-6 w-6" })
530
+ }), /* @__PURE__ */ y("div", {
531
+ className: "min-w-0 flex-1",
532
+ children: [
533
+ /* @__PURE__ */ v("h3", {
534
+ className: "truncate font-medium text-text-primary",
535
+ children: t.name
536
+ }),
537
+ /* @__PURE__ */ v("p", {
538
+ className: "truncate text-sm text-text-secondary",
539
+ children: b(t.category)
540
+ }),
541
+ t.address && /* @__PURE__ */ v("p", {
542
+ className: "truncate text-xs text-text-secondary",
543
+ children: t.address
544
+ })
545
+ ]
546
+ })]
547
+ }),
548
+ /* @__PURE__ */ y("div", {
549
+ className: "mb-3 flex flex-wrap items-center gap-2",
550
+ children: [
551
+ /* @__PURE__ */ v(Z, { status: t.status }),
552
+ t.rating > 0 && /* @__PURE__ */ y("span", {
553
+ className: "inline-flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2.5 py-0.5 text-xs font-medium text-status-warning-text",
600
554
  children: [
601
- /* @__PURE__ */ b("div", {
602
- className: "flex items-center gap-2 mb-1",
603
- children: [/* @__PURE__ */ y("div", {
604
- className: "w-16",
605
- children: K(e.complianceScore)
606
- }), /* @__PURE__ */ b("span", {
607
- className: "font-medium text-text-primary",
608
- children: [e.complianceScore, "%"]
609
- })]
610
- }),
611
- /* @__PURE__ */ b("p", {
612
- className: "text-xs text-text-secondary",
613
- children: [
614
- "Docs: ",
615
- e.documentsSubmitted,
616
- "/",
617
- e.documentsRequired
618
- ]
619
- }),
620
- /* @__PURE__ */ b("p", {
621
- className: "text-xs text-text-secondary",
622
- children: ["Applied: ", U(e.applicationDate)]
623
- })
555
+ /* @__PURE__ */ v(h, { className: "h-3 w-3 fill-current" }),
556
+ t.rating.toFixed(1),
557
+ " (",
558
+ t.reviewCount,
559
+ ")"
624
560
  ]
625
561
  }),
626
- /* @__PURE__ */ y("td", {
627
- className: "px-4 py-3",
628
- children: /* @__PURE__ */ b("div", {
629
- className: "flex flex-col gap-1",
630
- children: [
631
- /* @__PURE__ */ b("button", {
632
- type: "button",
633
- onClick: () => V(e, "view"),
634
- className: "rounded p-1.5 text-text-secondary hover:text-text-primary hover:bg-accent transition-colors inline-flex items-center gap-1 text-xs",
635
- children: [/* @__PURE__ */ y(u, { className: "h-4 w-4" }), " View"]
636
- }),
637
- !e.isVerified && e.inspectionStatus !== "failed" && /* @__PURE__ */ b("div", {
638
- className: "flex gap-1",
639
- children: [/* @__PURE__ */ y("button", {
640
- type: "button",
641
- onClick: () => V(e, "approve"),
642
- className: "rounded p-1.5 text-text-secondary hover:text-status-success-text hover:bg-status-success-bg-subtle transition-colors",
643
- children: /* @__PURE__ */ y(c, { className: "h-4 w-4" })
644
- }), /* @__PURE__ */ y("button", {
645
- type: "button",
646
- onClick: () => V(e, "reject"),
647
- className: "rounded p-1.5 text-text-secondary hover:text-status-error-text hover:bg-status-error-bg-subtle transition-colors",
648
- children: /* @__PURE__ */ y(_, { className: "h-4 w-4" })
649
- })]
650
- }),
651
- e.inspectionStatus === "pending" && /* @__PURE__ */ b("button", {
652
- type: "button",
653
- onClick: () => V(e, "inspect"),
654
- className: "rounded p-1.5 text-text-secondary hover:text-text-primary hover:bg-[var(--color-accent-soft)] transition-colors inline-flex items-center gap-1 text-xs",
655
- children: [/* @__PURE__ */ y(l, { className: "h-4 w-4" }), " Inspect"]
656
- }),
657
- e.isActive && /* @__PURE__ */ y("button", {
658
- type: "button",
659
- onClick: () => V(e, "suspend"),
660
- className: "rounded p-1.5 text-text-secondary hover:text-status-error-text hover:bg-status-error-bg-subtle transition-colors",
661
- children: /* @__PURE__ */ y(f, { className: "h-4 w-4" })
662
- })
663
- ]
664
- })
562
+ t.avgOrderValue > 0 && /* @__PURE__ */ y("span", {
563
+ className: "text-xs text-text-secondary",
564
+ children: ["Avg ", Y(t.avgOrderValue)]
665
565
  })
666
566
  ]
667
- }, e.id))
668
- })]
669
- })
670
- }),
671
- z.length === 0 && /* @__PURE__ */ y(r, {
672
- illustration: "empty-search",
673
- title: "No carts found",
674
- description: "No service providers match your current filters. Try clearing the filters or searching for a different name.",
675
- action: /* @__PURE__ */ y("button", {
676
- type: "button",
677
- onClick: () => I({
678
- searchQuery: "",
679
- status: "",
680
- verificationStatus: "",
681
- category: "",
682
- location: "",
683
- sortBy: "recent"
684
- }),
685
- className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
686
- children: "Clear filters"
687
- })
567
+ }),
568
+ /* @__PURE__ */ v("div", {
569
+ className: "mb-3",
570
+ children: /* @__PURE__ */ v(Q, {
571
+ m: t,
572
+ compact: !0
573
+ })
574
+ }),
575
+ /* @__PURE__ */ y("button", {
576
+ type: "button",
577
+ onClick: () => I(n ? null : t.id),
578
+ className: "flex w-full items-center justify-center gap-1 rounded-lg border border-border-subtle py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
579
+ children: [n ? "Hide details" : "View details", /* @__PURE__ */ v(f, { className: e("h-4 w-4 transition-transform", n && "rotate-180") })]
580
+ }),
581
+ n && /* @__PURE__ */ v("div", {
582
+ className: "mt-3",
583
+ children: /* @__PURE__ */ v($, { m: t })
584
+ })
585
+ ]
586
+ }, t.id);
688
587
  })
689
- ]
588
+ })]
690
589
  }),
691
- k && D && /* @__PURE__ */ y("div", {
590
+ V && L && /* @__PURE__ */ v("div", {
692
591
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
693
- children: /* @__PURE__ */ b("div", {
694
- className: "w-full max-w-2xl rounded-lg border border-border-subtle bg-bg-surface shadow-lg max-h-[90vh] overflow-y-auto",
695
- children: [/* @__PURE__ */ b("div", {
696
- className: "flex items-center justify-between p-4 border-b border-border-subtle",
697
- children: [/* @__PURE__ */ y("h3", {
592
+ children: /* @__PURE__ */ y("div", {
593
+ className: "max-h-[90vh] w-full max-w-lg overflow-y-auto rounded-lg border border-border-subtle bg-bg-surface shadow-lg",
594
+ children: [/* @__PURE__ */ y("div", {
595
+ className: "flex items-center justify-between border-b border-border-subtle p-4",
596
+ children: [/* @__PURE__ */ v("h3", {
698
597
  className: "text-lg font-semibold text-text-primary",
699
- children: j === "view" ? "Cart Details" : j === "approve" ? "Approve Cart" : j === "reject" ? "Reject Cart" : j === "suspend" ? "Suspend Cart" : "Schedule Inspection"
700
- }), /* @__PURE__ */ y("button", {
598
+ children: z === "approve" ? "Approve Merchant" : z === "reject" ? "Reject Merchant" : "Suspend Merchant"
599
+ }), /* @__PURE__ */ v("button", {
701
600
  type: "button",
702
- onClick: () => A(!1),
703
- className: "rounded p-1.5 text-text-secondary hover:text-text-primary hover:bg-accent transition-colors",
704
- children: /* @__PURE__ */ y(g, { className: "h-5 w-5" })
601
+ onClick: () => H(!1),
602
+ className: "rounded p-1.5 text-text-secondary transition-colors hover:bg-accent hover:text-text-primary",
603
+ children: /* @__PURE__ */ v(_, { className: "h-5 w-5" })
705
604
  })]
706
- }), /* @__PURE__ */ b("div", {
707
- className: "p-4 space-y-4",
605
+ }), /* @__PURE__ */ y("div", {
606
+ className: "space-y-4 p-4",
708
607
  children: [
709
- /* @__PURE__ */ b("div", {
710
- className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
711
- children: [
712
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
713
- className: "text-sm text-text-secondary",
714
- children: "Cart Name"
715
- }), /* @__PURE__ */ y("p", {
716
- className: "font-medium text-text-primary",
717
- children: D.name
718
- })] }),
719
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
720
- className: "text-sm text-text-secondary",
721
- children: "Category"
722
- }), /* @__PURE__ */ y("p", {
723
- className: "font-medium text-text-primary",
724
- children: D.category
725
- })] }),
726
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
727
- className: "text-sm text-text-secondary",
728
- children: "Owner"
729
- }), /* @__PURE__ */ y("p", {
730
- className: "font-medium text-text-primary",
731
- children: D.ownerName
732
- })] }),
733
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
734
- className: "text-sm text-text-secondary",
735
- children: "Contact"
736
- }), /* @__PURE__ */ y("p", {
737
- className: "font-medium text-text-primary",
738
- children: D.ownerPhone
739
- })] })
740
- ]
608
+ /* @__PURE__ */ y("div", {
609
+ className: "flex items-center gap-3 rounded-lg bg-bg-sunken/50 p-3",
610
+ children: [/* @__PURE__ */ v("div", {
611
+ className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary",
612
+ children: /* @__PURE__ */ v(g, { className: "h-5 w-5" })
613
+ }), /* @__PURE__ */ y("div", {
614
+ className: "min-w-0",
615
+ children: [/* @__PURE__ */ v("p", {
616
+ className: "truncate font-medium text-text-primary",
617
+ children: L.name
618
+ }), /* @__PURE__ */ v("p", {
619
+ className: "truncate text-sm text-text-secondary",
620
+ children: b(L.category)
621
+ })]
622
+ })]
741
623
  }),
742
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
743
- className: "text-sm text-text-secondary",
744
- children: "Description"
745
- }), /* @__PURE__ */ y("p", {
746
- className: "font-medium text-text-primary",
747
- children: D.description
748
- })] }),
749
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
750
- className: "text-sm text-text-secondary",
751
- children: "Location"
752
- }), /* @__PURE__ */ y("p", {
753
- className: "font-medium text-text-primary",
754
- children: D.address
755
- })] }),
756
- /* @__PURE__ */ b("div", {
757
- className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
758
- children: [
759
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
760
- className: "text-sm text-text-secondary",
761
- children: "Compliance Score"
762
- }), /* @__PURE__ */ b("p", {
763
- className: "font-medium text-text-primary",
764
- children: [D.complianceScore, "%"]
765
- })] }),
766
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
767
- className: "text-sm text-text-secondary",
768
- children: "Documents"
769
- }), /* @__PURE__ */ b("p", {
770
- className: "font-medium text-text-primary",
771
- children: [
772
- D.documentsSubmitted,
773
- "/",
774
- D.documentsRequired
775
- ]
776
- })] }),
777
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
778
- className: "text-sm text-text-secondary",
779
- children: "Monthly Revenue"
780
- }), /* @__PURE__ */ y("p", {
781
- className: "font-medium text-text-primary",
782
- children: a(D.monthlyRevenue, { minimumFractionDigits: 0 })
783
- })] })
784
- ]
624
+ z === "approve" && /* @__PURE__ */ v("div", {
625
+ className: "rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3",
626
+ children: /* @__PURE__ */ v("p", {
627
+ className: "text-sm text-status-success-text",
628
+ children: "This marks the merchant as verified and active, so customers can start ordering from it."
629
+ })
785
630
  }),
786
- D.rejectionReason && /* @__PURE__ */ b("div", {
787
- className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle p-4",
788
- children: [/* @__PURE__ */ y("p", {
789
- className: "text-sm font-medium text-status-error-text",
790
- children: "Previous Rejection Reason:"
791
- }), /* @__PURE__ */ y("p", {
792
- className: "text-sm text-status-error-text/80",
793
- children: D.rejectionReason
794
- })]
631
+ z === "suspend" && /* @__PURE__ */ v("div", {
632
+ className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle p-3",
633
+ children: /* @__PURE__ */ v("p", {
634
+ className: "text-sm text-status-error-text",
635
+ children: "This suspends the merchant. It will be hidden from customers until reinstated."
636
+ })
795
637
  }),
796
- j === "reject" && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
797
- className: "block text-sm font-medium text-text-primary mb-2",
638
+ z === "reject" && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
639
+ className: "mb-2 block text-sm font-medium text-text-primary",
798
640
  children: "Rejection Reason *"
799
- }), /* @__PURE__ */ y("textarea", {
800
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface p-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] min-h-[100px]",
641
+ }), /* @__PURE__ */ v("textarea", {
642
+ className: "min-h-[100px] w-full rounded-lg border border-border-subtle bg-bg-surface p-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
801
643
  rows: 4,
802
- value: N,
803
- onChange: (e) => P(e.target.value),
804
- placeholder: "Please provide a detailed reason for rejection..."
644
+ value: U,
645
+ onChange: (e) => W(e.target.value),
646
+ placeholder: "Explain why this application is being rejected..."
805
647
  })] }),
806
- j === "approve" && /* @__PURE__ */ y("div", {
807
- className: "rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-4",
808
- children: /* @__PURE__ */ y("p", {
809
- className: "text-sm text-status-success-text",
810
- children: "This will approve the cart for operation on the platform. The cart owner will be notified and the cart will become active."
811
- })
812
- }),
813
- /* @__PURE__ */ b("div", {
648
+ /* @__PURE__ */ y("div", {
814
649
  className: "flex gap-3 pt-2",
815
- children: [/* @__PURE__ */ y("button", {
650
+ children: [/* @__PURE__ */ v("button", {
816
651
  type: "button",
817
- onClick: () => A(!1),
818
- className: "flex-1 rounded-lg border border-border-subtle py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
652
+ onClick: () => H(!1),
653
+ className: "flex-1 rounded-lg border border-border-subtle py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
819
654
  children: "Cancel"
820
- }), j !== "view" && /* @__PURE__ */ y("button", {
655
+ }), /* @__PURE__ */ v("button", {
821
656
  type: "button",
822
- onClick: H,
823
- disabled: j === "reject" && !N.trim(),
824
- className: "flex-1 rounded-lg bg-action-primary-bg py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
825
- children: j === "approve" ? "Approve Cart" : j === "reject" ? "Reject Cart" : j === "suspend" ? "Suspend Cart" : "Schedule Inspection"
657
+ onClick: de,
658
+ disabled: C.isPending || z === "reject" && !U.trim(),
659
+ className: "flex-1 rounded-lg bg-action-primary-bg py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg-hover disabled:cursor-not-allowed disabled:opacity-50",
660
+ children: C.isPending ? "Working…" : z === "approve" ? "Approve Merchant" : z === "reject" ? "Reject Merchant" : "Suspend Merchant"
826
661
  })]
827
662
  })
828
663
  ]
@@ -833,6 +668,6 @@ function w() {
833
668
  });
834
669
  }
835
670
  //#endregion
836
- export { w as CartManagementPage };
671
+ export { S as CartManagementPage };
837
672
 
838
673
  //# sourceMappingURL=CartManagementPage.js.map