@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
@@ -2,25 +2,28 @@ import { useKadaikodi as e } from "../../context/KadaikodiContext.js";
2
2
  import { cn as t } from "../../utils/cn.js";
3
3
  import { PageLayout as n } from "../../components/PageLayout.js";
4
4
  import { EmptyState as r } from "../../components/EmptyState.js";
5
- import { formatDate as i } from "../../utils/formatters.js";
6
- import { RatingDisplay as a } from "../../components/RatingDisplay.js";
7
- import { useCallback as o, useState as s } from "react";
8
- import { CheckCircle2 as c, Info as l, MessageCircle as u, MessageSquare as d, PenSquare as f, Search as p, Star as m, ThumbsUp as h, X as g } from "lucide-react";
9
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
10
- import { EmphasisPanel as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
5
+ import { useCreateReview as i, useOrders as a, useProviders as ee, useReviews as o } from "../../hooks/useKadaikodiApi.js";
6
+ import { formatRelativeTime as s } from "../../utils/formatters.js";
7
+ import { RatingStars as c } from "../../components/viz/RatingStars.js";
8
+ import "../../components/viz/index.js";
9
+ import { ProviderImage as l } from "./shared.js";
10
+ import { useMemo as u, useState as d } from "react";
11
+ import { CheckCircle2 as f, Loader2 as p, MessageCircle as m, MessageSquare as h, PenSquare as g, Search as _, Star as v } from "lucide-react";
12
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
13
+ import { EmphasisPanel as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
11
14
  //#region src/kadaikodi/pages/customer/ReviewsPage.tsx
12
- var x = {
15
+ var C = {
13
16
  1: "Terrible",
14
17
  2: "Poor",
15
18
  3: "Average",
16
19
  4: "Good",
17
20
  5: "Excellent"
18
21
  };
19
- function S({ value: e, onChange: n }) {
20
- let [r, i] = s(0), a = r || e;
21
- return /* @__PURE__ */ v("div", {
22
+ function w({ value: e, onChange: n }) {
23
+ let [r, i] = d(0), a = r || e;
24
+ return /* @__PURE__ */ b("div", {
22
25
  className: "flex items-center gap-3",
23
- children: [/* @__PURE__ */ _("div", {
26
+ children: [/* @__PURE__ */ y("div", {
24
27
  className: "flex items-center gap-0.5",
25
28
  children: [
26
29
  1,
@@ -28,49 +31,51 @@ function S({ value: e, onChange: n }) {
28
31
  3,
29
32
  4,
30
33
  5
31
- ].map((e) => /* @__PURE__ */ _("button", {
34
+ ].map((e) => /* @__PURE__ */ y("button", {
32
35
  type: "button",
33
36
  onClick: () => n(e),
34
37
  onMouseEnter: () => i(e),
35
38
  onMouseLeave: () => i(0),
36
- className: "p-0.5 transition-transform",
37
- children: /* @__PURE__ */ _(m, { className: t("h-6 w-6", e <= a ? "fill-status-warning-text text-status-warning-text" : "fill-none text-text-secondary/40") })
39
+ className: "p-0.5 transition-transform hover:scale-110",
40
+ "aria-label": `${e} star${e > 1 ? "s" : ""}`,
41
+ children: /* @__PURE__ */ y(v, { className: t("h-7 w-7", e <= a ? "fill-status-warning-text text-status-warning-text" : "fill-none text-text-secondary/40") })
38
42
  }, e))
39
- }), /* @__PURE__ */ _("span", {
43
+ }), /* @__PURE__ */ y("span", {
40
44
  className: "text-sm font-medium text-text-secondary",
41
- children: x[a] ?? ""
45
+ children: C[a] ?? ""
42
46
  })]
43
47
  });
44
48
  }
45
- function C() {
46
- let { navigateTo: x, currentUser: C } = e(), w = C?.id ?? "", [T, E] = s([]), [D, O] = s(!1), [k, A] = s({
47
- rating: 5,
48
- title: "",
49
- comment: ""
50
- }), [j, M] = s({
51
- searchQuery: "",
52
- type: "all",
53
- rating: "",
54
- sortBy: "recent"
55
- }), [N, P] = s(null), F = (e) => {
56
- P(e), setTimeout(() => P(null), 3e3);
57
- }, I = o(() => {
58
- let e = [...T];
59
- if (j.type === "my-reviews" ? e = e.filter((e) => e.userId === w) : j.type !== "all" && (e = e.filter((e) => e.itemType === j.type)), j.rating) {
60
- let t = parseInt(j.rating, 10);
61
- e = e.filter((e) => e.rating === t);
49
+ function T() {
50
+ let { navigateTo: C, currentUser: T } = e(), { data: E = [], isLoading: D } = ee(), { data: O = [] } = a({ customerId: T?.id }), k = i(), A = u(() => O.filter((e) => e.status === "delivered"), [O]), j = u(() => new Set(A.map((e) => e.cartId)), [A]), [M, N] = d(""), P = M || A[0]?.cartId || E[0]?.id || "", F = u(() => E.find((e) => e.id === P), [E, P]), { data: I = [], isLoading: L } = o(P), [R, z] = d(""), [B, V] = d(""), [H, U] = d("recent"), [W, G] = d(5), [K, q] = d(""), [J, Y] = d(null), X = (e) => {
51
+ Y(e), setTimeout(() => Y(null), 3e3);
52
+ }, Z = u(() => {
53
+ let e = {
54
+ 5: 0,
55
+ 4: 0,
56
+ 3: 0,
57
+ 2: 0,
58
+ 1: 0
59
+ };
60
+ for (let t of I) {
61
+ let n = Math.min(5, Math.max(1, Math.round(t.rating)));
62
+ e[n] += 1;
62
63
  }
63
- if (j.searchQuery) {
64
- let t = j.searchQuery.toLowerCase();
65
- e = e.filter((e) => e.itemName.toLowerCase().includes(t) || e.title.toLowerCase().includes(t) || e.comment.toLowerCase().includes(t) || e.cartName.toLowerCase().includes(t));
64
+ return e;
65
+ }, [I]), Q = u(() => {
66
+ let e = [...I];
67
+ if (B) {
68
+ let t = parseInt(B, 10);
69
+ e = e.filter((e) => Math.round(e.rating) === t);
70
+ }
71
+ if (R.trim()) {
72
+ let t = R.toLowerCase();
73
+ e = e.filter((e) => (e.review ?? "").toLowerCase().includes(t) || (e.response ?? "").toLowerCase().includes(t));
66
74
  }
67
- switch (j.sortBy) {
75
+ switch (H) {
68
76
  case "recent":
69
77
  e.sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime());
70
78
  break;
71
- case "helpful":
72
- e.sort((e, t) => t.helpfulCount - e.helpfulCount);
73
- break;
74
79
  case "rating-high":
75
80
  e.sort((e, t) => t.rating - e.rating);
76
81
  break;
@@ -79,410 +84,309 @@ function C() {
79
84
  break;
80
85
  }
81
86
  return e;
82
- }, [T, j])(), L = T.filter((e) => e.userId === w).length, R = T.length > 0 ? (T.reduce((e, t) => e + t.rating, 0) / T.length).toFixed(1) : "0", z = () => {
83
- if (!k.title.trim() || !k.comment.trim()) {
84
- alert("Please fill in the Review Title and Comment.");
85
- return;
86
- }
87
- A({
88
- rating: 5,
89
- title: "",
90
- comment: ""
91
- }), O(!1), F("To post a review, open a delivered order and rate it from there.");
92
- }, B = (e) => {
93
- E((t) => t.map((t) => t.id === e ? {
94
- ...t,
95
- isHelpful: !t.isHelpful,
96
- helpfulCount: t.isHelpful ? t.helpfulCount - 1 : t.helpfulCount + 1
97
- } : t));
98
- };
99
- return /* @__PURE__ */ v(n, {
87
+ }, [
88
+ I,
89
+ B,
90
+ R,
91
+ H
92
+ ]), $ = u(() => A.find((e) => e.cartId === P), [A, P]), te = !!($ && T?.id);
93
+ return D ? /* @__PURE__ */ y(n, {
100
94
  title: "Reviews & Ratings",
101
- description: `${I.length} reviews found`,
102
- actions: /* @__PURE__ */ v("button", {
103
- type: "button",
104
- onClick: () => O(!0),
105
- className: t("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-opacity", "bg-foreground text-background hover:opacity-90"),
106
- children: [/* @__PURE__ */ _(f, { className: "h-4 w-4" }), "Write Review"]
107
- }),
95
+ children: /* @__PURE__ */ y("div", {
96
+ className: "flex h-[60vh] items-center justify-center",
97
+ children: /* @__PURE__ */ y(p, { className: "h-8 w-8 animate-spin text-accent-primary" })
98
+ })
99
+ }) : F ? /* @__PURE__ */ b(n, {
100
+ title: "Reviews & Ratings",
101
+ description: `${I.length} reviews`,
108
102
  children: [
109
- N && /* @__PURE__ */ v("div", {
110
- className: "mb-4 rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3 flex items-center gap-2",
111
- children: [/* @__PURE__ */ _(c, { className: "h-4 w-4 text-status-success-text shrink-0" }), /* @__PURE__ */ _("p", {
103
+ J && /* @__PURE__ */ b("div", {
104
+ className: "mb-4 flex items-center gap-2 rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3",
105
+ children: [/* @__PURE__ */ y(f, { className: "h-4 w-4 text-status-success-text shrink-0" }), /* @__PURE__ */ y("p", {
112
106
  className: "text-sm text-status-success-text",
113
- children: N
107
+ children: J
114
108
  })]
115
109
  }),
116
- /* @__PURE__ */ _(b, {
110
+ /* @__PURE__ */ y(S, {
117
111
  className: "mb-6",
118
- children: "Your voice on the carts you've tried — write honest reviews to help other customers and give vendors feedback they can act on. Browse what others said, then add your own rating for a recent order."
112
+ children: "Honest ratings for the carts on Kadaikodi — pick a cart to see its aggregate score and every review, then add your own for an order you've had delivered."
119
113
  }),
120
- /* @__PURE__ */ _(y, {
114
+ /* @__PURE__ */ b("div", {
121
115
  className: "mb-6",
122
- children: /* @__PURE__ */ v("div", {
123
- className: "flex flex-wrap items-center gap-4 text-sm text-text-secondary",
124
- children: [
125
- /* @__PURE__ */ v("span", { children: [T.length, " total reviews"] }),
126
- /* @__PURE__ */ v("span", { children: [L, " your reviews"] }),
127
- /* @__PURE__ */ v("span", {
128
- className: "flex items-center gap-1",
129
- children: [
130
- "Average: ",
131
- R,
132
- /* @__PURE__ */ _(m, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" })
133
- ]
116
+ children: [/* @__PURE__ */ y("label", {
117
+ className: "mb-1.5 block text-sm font-medium text-text-primary",
118
+ children: "Viewing reviews for"
119
+ }), /* @__PURE__ */ y("select", {
120
+ value: P,
121
+ onChange: (e) => N(e.target.value),
122
+ className: "w-full max-w-sm 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)]",
123
+ children: E.map((e) => /* @__PURE__ */ b("option", {
124
+ value: e.id,
125
+ children: [e.name, j.has(e.id) ? " • ordered" : ""]
126
+ }, e.id))
127
+ })]
128
+ }),
129
+ /* @__PURE__ */ y(x, {
130
+ className: "mb-6",
131
+ children: /* @__PURE__ */ b("div", {
132
+ className: "flex flex-col gap-5 sm:flex-row sm:items-center",
133
+ children: [/* @__PURE__ */ b("div", {
134
+ className: "flex items-center gap-4",
135
+ children: [/* @__PURE__ */ y("div", {
136
+ className: "h-16 w-16 shrink-0 overflow-hidden rounded-xl",
137
+ children: /* @__PURE__ */ y(l, {
138
+ src: F.image,
139
+ alt: F.name,
140
+ seed: F.name
141
+ })
142
+ }), /* @__PURE__ */ b("div", { children: [
143
+ /* @__PURE__ */ y("p", {
144
+ className: "text-4xl font-bold leading-none text-text-primary",
145
+ children: F.rating.toFixed(1)
146
+ }),
147
+ /* @__PURE__ */ y("div", {
148
+ className: "mt-1.5",
149
+ children: /* @__PURE__ */ y(c, {
150
+ value: F.rating,
151
+ size: 16
152
+ })
153
+ }),
154
+ /* @__PURE__ */ b("p", {
155
+ className: "mt-1 text-xs text-text-secondary",
156
+ children: [F.totalRatings, " ratings"]
157
+ })
158
+ ] })]
159
+ }), /* @__PURE__ */ y("div", {
160
+ className: "flex-1 space-y-1.5",
161
+ children: [
162
+ 5,
163
+ 4,
164
+ 3,
165
+ 2,
166
+ 1
167
+ ].map((e) => {
168
+ let t = Z[e], n = I.length ? t / I.length * 100 : 0;
169
+ return /* @__PURE__ */ b("div", {
170
+ className: "flex items-center gap-2 text-xs",
171
+ children: [
172
+ /* @__PURE__ */ b("span", {
173
+ className: "flex w-7 items-center gap-0.5 text-text-secondary",
174
+ children: [e, /* @__PURE__ */ y(v, { className: "h-3 w-3 fill-status-warning-text text-status-warning-text" })]
175
+ }),
176
+ /* @__PURE__ */ y("div", {
177
+ className: "h-2 flex-1 overflow-hidden rounded-full bg-bg-sunken",
178
+ children: /* @__PURE__ */ y("div", {
179
+ className: "h-full rounded-full bg-accent-primary transition-all",
180
+ style: { width: `${n}%` }
181
+ })
182
+ }),
183
+ /* @__PURE__ */ y("span", {
184
+ className: "w-6 text-right tabular-nums text-text-muted",
185
+ children: t
186
+ })
187
+ ]
188
+ }, e);
134
189
  })
135
- ]
190
+ })]
136
191
  })
137
192
  }),
138
- /* @__PURE__ */ _("div", {
139
- className: "rounded-lg border border-border-subtle bg-bg-surface p-4 mb-6",
140
- children: /* @__PURE__ */ v("div", {
141
- className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",
193
+ /* @__PURE__ */ b("div", {
194
+ className: "mb-6 rounded-xl border border-border-subtle bg-bg-surface p-5",
195
+ children: [/* @__PURE__ */ b("h2", {
196
+ className: "mb-3 flex items-center gap-2 text-base font-semibold text-text-primary",
197
+ children: [/* @__PURE__ */ y(g, { className: "h-4 w-4 text-text-secondary" }), "Write a review"]
198
+ }), te ? /* @__PURE__ */ b("div", {
199
+ className: "space-y-3",
142
200
  children: [
143
- /* @__PURE__ */ v("div", {
144
- className: "relative",
145
- children: [/* @__PURE__ */ _(p, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary" }), /* @__PURE__ */ _("input", {
146
- type: "text",
147
- placeholder: "Search reviews...",
148
- value: j.searchQuery,
149
- onChange: (e) => M((t) => ({
150
- ...t,
151
- searchQuery: e.target.value
152
- })),
153
- 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)]"
154
- })]
201
+ /* @__PURE__ */ y(w, {
202
+ value: W,
203
+ onChange: G
155
204
  }),
156
- /* @__PURE__ */ v("select", {
157
- value: j.type,
158
- onChange: (e) => M((t) => ({
159
- ...t,
160
- type: e.target.value
161
- })),
162
- 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)]",
163
- children: [
164
- /* @__PURE__ */ _("option", {
165
- value: "all",
166
- children: "All Reviews"
167
- }),
168
- /* @__PURE__ */ _("option", {
169
- value: "cart",
170
- children: "Cart Reviews"
171
- }),
172
- /* @__PURE__ */ _("option", {
173
- value: "product",
174
- children: "Product Reviews"
175
- }),
176
- /* @__PURE__ */ _("option", {
177
- value: "my-reviews",
178
- children: "My Reviews"
179
- })
180
- ]
205
+ /* @__PURE__ */ y("textarea", {
206
+ rows: 3,
207
+ value: K,
208
+ onChange: (e) => q(e.target.value),
209
+ placeholder: "Share your experience…",
210
+ className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-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)] resize-none"
181
211
  }),
182
- /* @__PURE__ */ v("select", {
183
- value: j.rating,
184
- onChange: (e) => M((t) => ({
185
- ...t,
186
- rating: e.target.value
187
- })),
188
- 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)]",
189
- children: [
190
- /* @__PURE__ */ _("option", {
191
- value: "",
192
- children: "All Ratings"
193
- }),
194
- /* @__PURE__ */ _("option", {
195
- value: "5",
196
- children: "5 Stars"
197
- }),
198
- /* @__PURE__ */ _("option", {
199
- value: "4",
200
- children: "4 Stars"
201
- }),
202
- /* @__PURE__ */ _("option", {
203
- value: "3",
204
- children: "3 Stars"
205
- }),
206
- /* @__PURE__ */ _("option", {
207
- value: "2",
208
- children: "2 Stars"
209
- }),
210
- /* @__PURE__ */ _("option", {
211
- value: "1",
212
- children: "1 Star"
213
- })
214
- ]
212
+ /* @__PURE__ */ y("div", {
213
+ className: "flex justify-end",
214
+ children: /* @__PURE__ */ b("button", {
215
+ type: "button",
216
+ onClick: () => {
217
+ if (!$ || !T?.id) {
218
+ X("Order from this cart and wait for delivery to leave a review.");
219
+ return;
220
+ }
221
+ k.mutate({
222
+ providerId: P,
223
+ orderId: $.id,
224
+ customerId: T.id,
225
+ rating: W,
226
+ review: K.trim() || void 0
227
+ }, {
228
+ onSuccess: () => {
229
+ q(""), G(5), X("Thanks! Your review has been posted.");
230
+ },
231
+ onError: () => X("Could not post your review. Please try again.")
232
+ });
233
+ },
234
+ disabled: k.isPending,
235
+ className: t("inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text transition-colors", k.isPending ? "opacity-60 cursor-not-allowed" : "hover:bg-action-primary-bg-hover"),
236
+ children: [k.isPending && /* @__PURE__ */ y(p, { className: "h-4 w-4 animate-spin" }), "Submit Review"]
237
+ })
238
+ })
239
+ ]
240
+ }) : /* @__PURE__ */ b("p", {
241
+ className: "rounded-lg bg-bg-sunken p-3 text-xs text-text-secondary",
242
+ children: [
243
+ "You can review ",
244
+ /* @__PURE__ */ y("span", {
245
+ className: "font-medium text-text-primary",
246
+ children: F.name
215
247
  }),
216
- /* @__PURE__ */ v("select", {
217
- value: j.sortBy,
218
- onChange: (e) => M((t) => ({
219
- ...t,
220
- sortBy: e.target.value
221
- })),
222
- 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)]",
223
- children: [
224
- /* @__PURE__ */ _("option", {
225
- value: "recent",
226
- children: "Most Recent"
227
- }),
228
- /* @__PURE__ */ _("option", {
229
- value: "helpful",
230
- children: "Most Helpful"
231
- }),
232
- /* @__PURE__ */ _("option", {
233
- value: "rating-high",
234
- children: "Highest Rating"
235
- }),
236
- /* @__PURE__ */ _("option", {
237
- value: "rating-low",
238
- children: "Lowest Rating"
239
- })
240
- ]
248
+ " ",
249
+ "once one of your orders from it has been delivered.",
250
+ " ",
251
+ /* @__PURE__ */ y("button", {
252
+ type: "button",
253
+ onClick: () => C(`/customer/cart/${F.id}`),
254
+ className: "font-medium text-accent-primary hover:underline",
255
+ children: "Order now"
241
256
  })
242
257
  ]
243
- })
258
+ })]
244
259
  }),
245
- I.length === 0 ? /* @__PURE__ */ _(r, {
246
- icon: /* @__PURE__ */ _(d, { className: "h-12 w-12" }),
247
- title: "No reviews found",
248
- description: "Be the first to write a review!",
249
- action: /* @__PURE__ */ _("button", {
250
- type: "button",
251
- onClick: () => O(!0),
252
- className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
253
- children: "Write a Review"
254
- })
255
- }) : /* @__PURE__ */ _("div", {
256
- className: "space-y-4",
257
- children: I.map((e) => {
258
- let n = e.userId === w;
259
- return /* @__PURE__ */ v("div", {
260
- className: t("rounded-lg border bg-bg-surface p-5", n ? "border-foreground/20" : "border-border-subtle"),
260
+ /* @__PURE__ */ b("div", {
261
+ className: "mb-6 grid grid-cols-1 gap-3 sm:grid-cols-3",
262
+ children: [
263
+ /* @__PURE__ */ b("div", {
264
+ className: "relative sm:col-span-1",
265
+ children: [/* @__PURE__ */ y(_, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ y("input", {
266
+ type: "text",
267
+ placeholder: "Search reviews…",
268
+ value: R,
269
+ onChange: (e) => z(e.target.value),
270
+ 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)]"
271
+ })]
272
+ }),
273
+ /* @__PURE__ */ b("select", {
274
+ value: B,
275
+ onChange: (e) => V(e.target.value),
276
+ 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)]",
261
277
  children: [
262
- /* @__PURE__ */ v("div", {
263
- className: "flex items-start gap-3 mb-3",
264
- children: [
265
- /* @__PURE__ */ _("img", {
266
- src: e.userAvatar,
267
- alt: e.userName,
268
- className: "h-10 w-10 rounded-full object-cover shrink-0"
269
- }),
270
- /* @__PURE__ */ v("div", {
271
- className: "flex-1 min-w-0",
272
- children: [/* @__PURE__ */ v("div", {
273
- className: "flex items-center gap-2 flex-wrap",
274
- children: [
275
- /* @__PURE__ */ _("span", {
276
- className: "text-sm font-semibold text-text-primary",
277
- children: e.userName
278
- }),
279
- e.isVerified && /* @__PURE__ */ v("span", {
280
- className: "inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-[10px] font-medium text-status-success-text",
281
- children: [/* @__PURE__ */ _(c, { className: "h-3 w-3" }), "Verified"]
282
- }),
283
- n && /* @__PURE__ */ _("span", {
284
- className: "inline-flex items-center rounded-full bg-[var(--color-accent-soft)] px-2 py-0.5 text-[10px] font-medium text-text-primary",
285
- children: "Your Review"
286
- })
287
- ]
288
- }), /* @__PURE__ */ v("div", {
289
- className: "flex flex-wrap items-center gap-2 text-xs text-text-secondary mt-0.5",
290
- children: [/* @__PURE__ */ v("span", { children: [e.itemType === "cart" ? /* @__PURE__ */ _(d, { className: "inline h-3 w-3 mr-0.5" }) : /* @__PURE__ */ _(m, { className: "inline h-3 w-3 mr-0.5" }), e.itemName] }), /* @__PURE__ */ _("span", { children: i(e.createdAt, {
291
- hour: void 0,
292
- minute: void 0,
293
- hour12: void 0
294
- }) })]
295
- })]
296
- }),
297
- /* @__PURE__ */ v("div", {
298
- className: "shrink-0",
299
- children: [/* @__PURE__ */ _(a, {
300
- value: e.rating,
301
- size: "sm"
302
- }), /* @__PURE__ */ v("p", {
303
- className: "text-xs text-text-secondary mt-0.5 text-right",
304
- children: ["From: ", e.cartName]
305
- })]
306
- })
307
- ]
278
+ /* @__PURE__ */ y("option", {
279
+ value: "",
280
+ children: "All ratings"
308
281
  }),
309
- /* @__PURE__ */ v("div", {
310
- className: "mb-3",
311
- children: [/* @__PURE__ */ _("h4", {
312
- className: "text-sm font-semibold text-text-primary mb-1",
313
- children: e.title
314
- }), /* @__PURE__ */ _("p", {
315
- className: "text-sm text-text-primary leading-relaxed",
316
- children: e.comment
317
- })]
282
+ /* @__PURE__ */ y("option", {
283
+ value: "5",
284
+ children: "5 stars"
318
285
  }),
319
- e.images && e.images.length > 0 && /* @__PURE__ */ _("div", {
320
- className: "mb-3 flex gap-2 overflow-x-auto pb-1",
321
- children: e.images.map((e, t) => /* @__PURE__ */ _("img", {
322
- src: e,
323
- alt: `Review image ${t + 1}`,
324
- className: "h-20 w-20 rounded-lg object-cover shrink-0"
325
- }, t))
286
+ /* @__PURE__ */ y("option", {
287
+ value: "4",
288
+ children: "4 stars"
326
289
  }),
327
- e.response && /* @__PURE__ */ v("div", {
328
- className: "mb-3 rounded-lg border border-border-focus/20 bg-[var(--color-accent-soft)] p-3",
329
- children: [/* @__PURE__ */ v("div", {
330
- className: "flex flex-wrap items-center gap-2 mb-1.5",
331
- children: [
332
- /* @__PURE__ */ _(u, { className: "h-3.5 w-3.5 text-text-primary" }),
333
- /* @__PURE__ */ v("span", {
334
- className: "text-xs font-medium text-text-primary",
335
- children: ["Response from ", e.response.respondedBy]
336
- }),
337
- /* @__PURE__ */ _("span", {
338
- className: "text-[10px] text-text-primary/70",
339
- children: i(e.response.respondedAt, {
340
- hour: void 0,
341
- minute: void 0,
342
- hour12: void 0
343
- })
344
- })
345
- ]
346
- }), /* @__PURE__ */ _("p", {
347
- className: "text-xs text-text-primary leading-relaxed",
348
- children: e.response.message
349
- })]
290
+ /* @__PURE__ */ y("option", {
291
+ value: "3",
292
+ children: "3 stars"
350
293
  }),
351
- /* @__PURE__ */ v("div", {
352
- className: "flex items-center justify-between pt-3 border-t border-border-subtle",
353
- children: [/* @__PURE__ */ v("button", {
354
- type: "button",
355
- onClick: () => B(e.id),
356
- className: t("flex items-center gap-1.5 text-xs transition-colors", e.isHelpful ? "text-text-primary font-medium" : "text-text-secondary hover:text-text-primary"),
357
- children: [
358
- /* @__PURE__ */ _(h, { className: t("h-3.5 w-3.5", e.isHelpful && "fill-current") }),
359
- "Helpful (",
360
- e.helpfulCount,
361
- ")"
362
- ]
363
- }), /* @__PURE__ */ v("div", {
364
- className: "flex items-center gap-3 text-xs text-text-secondary",
365
- children: [/* @__PURE__ */ v("span", { children: ["Order: ", e.orderId] }), /* @__PURE__ */ _("button", {
366
- type: "button",
367
- onClick: () => x(`/customer/carts/${e.cartId}`),
368
- className: "font-medium hover:text-text-primary transition-colors",
369
- children: "View Cart"
370
- })]
371
- })]
294
+ /* @__PURE__ */ y("option", {
295
+ value: "2",
296
+ children: "2 stars"
297
+ }),
298
+ /* @__PURE__ */ y("option", {
299
+ value: "1",
300
+ children: "1 star"
372
301
  })
373
302
  ]
374
- }, e.id);
375
- })
303
+ }),
304
+ /* @__PURE__ */ b("select", {
305
+ value: H,
306
+ onChange: (e) => U(e.target.value),
307
+ 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)]",
308
+ children: [
309
+ /* @__PURE__ */ y("option", {
310
+ value: "recent",
311
+ children: "Most recent"
312
+ }),
313
+ /* @__PURE__ */ y("option", {
314
+ value: "rating-high",
315
+ children: "Highest rating"
316
+ }),
317
+ /* @__PURE__ */ y("option", {
318
+ value: "rating-low",
319
+ children: "Lowest rating"
320
+ })
321
+ ]
322
+ })
323
+ ]
376
324
  }),
377
- D && /* @__PURE__ */ _("div", {
378
- className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
379
- children: /* @__PURE__ */ _("div", {
380
- className: "w-full max-w-2xl max-h-[90vh] overflow-y-auto rounded-lg border border-border-subtle bg-bg-surface shadow-lg",
381
- children: /* @__PURE__ */ v("div", {
382
- className: "p-5",
325
+ L ? /* @__PURE__ */ y("div", {
326
+ className: "flex h-40 items-center justify-center",
327
+ children: /* @__PURE__ */ y(p, { className: "h-6 w-6 animate-spin text-accent-primary" })
328
+ }) : Q.length === 0 ? /* @__PURE__ */ y(r, {
329
+ icon: /* @__PURE__ */ y(h, { className: "h-12 w-12" }),
330
+ title: "No reviews yet",
331
+ description: `Be the first to review ${F.name}.`
332
+ }) : /* @__PURE__ */ y("div", {
333
+ className: "space-y-3",
334
+ children: Q.map((e) => {
335
+ let n = e.customerId === T?.id;
336
+ return /* @__PURE__ */ b("div", {
337
+ className: t("rounded-xl border bg-bg-surface p-4", n ? "border-action-primary-bg/40" : "border-border-subtle"),
383
338
  children: [
384
- /* @__PURE__ */ v("div", {
385
- className: "flex items-center justify-between mb-5",
386
- children: [/* @__PURE__ */ _("h3", {
387
- className: "text-lg font-semibold text-text-primary",
388
- children: "Write a Review"
389
- }), /* @__PURE__ */ _("button", {
390
- type: "button",
391
- onClick: () => O(!1),
392
- className: "rounded-md p-2 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors",
393
- children: /* @__PURE__ */ _(g, { className: "h-4 w-4" })
339
+ /* @__PURE__ */ b("div", {
340
+ className: "flex items-center justify-between gap-2",
341
+ children: [/* @__PURE__ */ b("div", {
342
+ className: "flex items-center gap-2",
343
+ children: [/* @__PURE__ */ y(c, {
344
+ value: e.rating,
345
+ size: 14
346
+ }), n && /* @__PURE__ */ y("span", {
347
+ className: "rounded-full bg-[var(--color-accent-soft)] px-2 py-0.5 text-[10px] font-medium text-accent-primary",
348
+ children: "Your review"
349
+ })]
350
+ }), /* @__PURE__ */ y("span", {
351
+ className: "text-xs text-text-muted",
352
+ children: s(e.createdAt)
394
353
  })]
395
354
  }),
396
- /* @__PURE__ */ v("div", {
397
- className: "space-y-4",
398
- children: [
399
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
400
- className: "block text-sm font-medium text-text-primary mb-2",
401
- children: ["Rating ", /* @__PURE__ */ _("span", {
402
- className: "text-status-error-text",
403
- children: "*"
404
- })]
405
- }), /* @__PURE__ */ _(S, {
406
- value: k.rating,
407
- onChange: (e) => A((t) => ({
408
- ...t,
409
- rating: e
410
- }))
411
- })] }),
412
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
413
- className: "block text-sm font-medium text-text-primary mb-1.5",
414
- children: ["Review Title ", /* @__PURE__ */ _("span", {
415
- className: "text-status-error-text",
416
- children: "*"
417
- })]
418
- }), /* @__PURE__ */ _("input", {
419
- type: "text",
420
- placeholder: "Summarize your experience",
421
- value: k.title,
422
- onChange: (e) => A((t) => ({
423
- ...t,
424
- title: e.target.value
425
- })),
426
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
427
- })] }),
428
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
429
- className: "block text-sm font-medium text-text-primary mb-1.5",
430
- children: ["Your Review ", /* @__PURE__ */ _("span", {
431
- className: "text-status-error-text",
432
- children: "*"
433
- })]
434
- }), /* @__PURE__ */ _("textarea", {
435
- rows: 5,
436
- placeholder: "Share your experience with others...",
437
- value: k.comment,
438
- onChange: (e) => A((t) => ({
439
- ...t,
440
- comment: e.target.value
441
- })),
442
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none"
443
- })] }),
444
- /* @__PURE__ */ v("div", {
445
- className: "rounded-lg bg-bg-sunken p-4",
446
- children: [/* @__PURE__ */ v("div", {
447
- className: "flex items-center gap-2 mb-2",
448
- children: [/* @__PURE__ */ _(l, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ _("h4", {
449
- className: "text-sm font-medium text-text-primary",
450
- children: "Review Guidelines"
451
- })]
452
- }), /* @__PURE__ */ v("ul", {
453
- className: "text-xs text-text-secondary space-y-1",
454
- children: [
455
- /* @__PURE__ */ _("li", { children: "- Be honest and helpful to other customers" }),
456
- /* @__PURE__ */ _("li", { children: "- Focus on your experience with the food and service" }),
457
- /* @__PURE__ */ _("li", { children: "- Avoid personal information or inappropriate content" }),
458
- /* @__PURE__ */ _("li", { children: "- Reviews are public and cannot be deleted once submitted" })
459
- ]
460
- })]
461
- })
462
- ]
355
+ e.review && /* @__PURE__ */ y("p", {
356
+ className: "mt-2 text-sm leading-relaxed text-text-primary",
357
+ children: e.review
463
358
  }),
464
- /* @__PURE__ */ v("div", {
465
- className: "flex items-center gap-3 pt-5",
466
- children: [/* @__PURE__ */ _("button", {
467
- type: "button",
468
- onClick: z,
469
- className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
470
- children: "Submit Review"
471
- }), /* @__PURE__ */ _("button", {
472
- type: "button",
473
- onClick: () => O(!1),
474
- className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
475
- children: "Cancel"
359
+ e.response && /* @__PURE__ */ b("div", {
360
+ className: "mt-3 rounded-lg border-l-2 border-accent-primary bg-[var(--color-accent-soft)] p-3",
361
+ children: [/* @__PURE__ */ b("p", {
362
+ className: "mb-1 flex items-center gap-1.5 text-xs font-medium text-text-primary",
363
+ children: [/* @__PURE__ */ y(m, { className: "h-3.5 w-3.5" }), "Owner response"]
364
+ }), /* @__PURE__ */ y("p", {
365
+ className: "text-xs leading-relaxed text-text-primary",
366
+ children: e.response
476
367
  })]
477
368
  })
478
369
  ]
479
- })
370
+ }, e.id);
480
371
  })
481
372
  })
482
373
  ]
374
+ }) : /* @__PURE__ */ y(n, {
375
+ title: "Reviews & Ratings",
376
+ children: /* @__PURE__ */ y(r, {
377
+ icon: /* @__PURE__ */ y(h, { className: "h-12 w-12" }),
378
+ title: "No carts to review yet",
379
+ description: "Browse carts and place an order — once it's delivered you can rate and review it.",
380
+ action: /* @__PURE__ */ y("button", {
381
+ type: "button",
382
+ onClick: () => C("/customer/discover"),
383
+ className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bg-hover transition-colors",
384
+ children: "Discover Carts"
385
+ })
386
+ })
483
387
  });
484
388
  }
485
389
  //#endregion
486
- export { C as ReviewsPage };
390
+ export { T as ReviewsPage };
487
391
 
488
392
  //# sourceMappingURL=ReviewsPage.js.map