@burdenoff/microfe-adaptercloud 2026.614.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +12 -0
  2. package/dist/adaptercloud/AdapterCloudRoot.js +177 -0
  3. package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -0
  4. package/dist/adaptercloud/AdapterCloudRoutes.js +215 -0
  5. package/dist/adaptercloud/AdapterCloudRoutes.js.map +1 -0
  6. package/dist/adaptercloud/components/EmptyState.js +28 -0
  7. package/dist/adaptercloud/components/EmptyState.js.map +1 -0
  8. package/dist/adaptercloud/components/InvestmentCard.js +96 -0
  9. package/dist/adaptercloud/components/InvestmentCard.js.map +1 -0
  10. package/dist/adaptercloud/components/MetricsCard.js +46 -0
  11. package/dist/adaptercloud/components/MetricsCard.js.map +1 -0
  12. package/dist/adaptercloud/components/PageLayout.js +26 -0
  13. package/dist/adaptercloud/components/PageLayout.js.map +1 -0
  14. package/dist/adaptercloud/components/RatingDisplay.js +35 -0
  15. package/dist/adaptercloud/components/RatingDisplay.js.map +1 -0
  16. package/dist/adaptercloud/components/StatusBadge.js +45 -0
  17. package/dist/adaptercloud/components/StatusBadge.js.map +1 -0
  18. package/dist/adaptercloud/context/AdapterCloudContext.js +93 -0
  19. package/dist/adaptercloud/context/AdapterCloudContext.js.map +1 -0
  20. package/dist/adaptercloud/context/index.js +1 -0
  21. package/dist/adaptercloud/hooks/useAdapterCloudApi.js +223 -0
  22. package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -0
  23. package/dist/adaptercloud/index.js +7 -0
  24. package/dist/adaptercloud/mocks/data.js +1517 -0
  25. package/dist/adaptercloud/mocks/data.js.map +1 -0
  26. package/dist/adaptercloud/mocks/users.js +34 -0
  27. package/dist/adaptercloud/mocks/users.js.map +1 -0
  28. package/dist/adaptercloud/pages/HomePage.js +921 -0
  29. package/dist/adaptercloud/pages/HomePage.js.map +1 -0
  30. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +645 -0
  31. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +1 -0
  32. package/dist/adaptercloud/pages/admin/AdminDashboard.js +639 -0
  33. package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +1 -0
  34. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +421 -0
  35. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +1 -0
  36. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +660 -0
  37. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +1 -0
  38. package/dist/adaptercloud/pages/admin/AdminProfilePage.js +259 -0
  39. package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +1 -0
  40. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +649 -0
  41. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +1 -0
  42. package/dist/adaptercloud/pages/admin/CartManagementPage.js +869 -0
  43. package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +1 -0
  44. package/dist/adaptercloud/pages/admin/UserManagementPage.js +893 -0
  45. package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +1 -0
  46. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +834 -0
  47. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +1 -0
  48. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +700 -0
  49. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +1 -0
  50. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +760 -0
  51. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +1 -0
  52. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +886 -0
  53. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +1 -0
  54. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +631 -0
  55. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +1 -0
  56. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +913 -0
  57. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +1 -0
  58. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +881 -0
  59. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +1 -0
  60. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +833 -0
  61. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +1 -0
  62. package/dist/adaptercloud/pages/common/HelpSupportPage.js +1325 -0
  63. package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +1 -0
  64. package/dist/adaptercloud/pages/common/NotificationCenterPage.js +665 -0
  65. package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +1 -0
  66. package/dist/adaptercloud/pages/common/SettingsPage.js +964 -0
  67. package/dist/adaptercloud/pages/common/SettingsPage.js.map +1 -0
  68. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +593 -0
  69. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +1 -0
  70. package/dist/adaptercloud/pages/customer/CartDetailPage.js +620 -0
  71. package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +1 -0
  72. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +547 -0
  73. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +1 -0
  74. package/dist/adaptercloud/pages/customer/CheckoutPage.js +532 -0
  75. package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +1 -0
  76. package/dist/adaptercloud/pages/customer/CustomerDashboard.js +496 -0
  77. package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +1 -0
  78. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +621 -0
  79. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +1 -0
  80. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +623 -0
  81. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +1 -0
  82. package/dist/adaptercloud/pages/customer/FavoritesPage.js +477 -0
  83. package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +1 -0
  84. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +438 -0
  85. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +1 -0
  86. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +388 -0
  87. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +1 -0
  88. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +488 -0
  89. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +1 -0
  90. package/dist/adaptercloud/pages/customer/ReviewsPage.js +606 -0
  91. package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +1 -0
  92. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +443 -0
  93. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +1 -0
  94. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +849 -0
  95. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +1 -0
  96. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +939 -0
  97. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +1 -0
  98. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +681 -0
  99. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +1 -0
  100. package/dist/adaptercloud/pages/investor/InvestorDashboard.js +419 -0
  101. package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +1 -0
  102. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +399 -0
  103. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +1 -0
  104. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +569 -0
  105. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +1 -0
  106. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +1065 -0
  107. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +1 -0
  108. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +496 -0
  109. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +1 -0
  110. package/dist/adaptercloud/pages/worker/WorkerDashboard.js +634 -0
  111. package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +1 -0
  112. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +675 -0
  113. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +1 -0
  114. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +687 -0
  115. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +1 -0
  116. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +578 -0
  117. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +1 -0
  118. package/dist/adaptercloud/store/adaptercloudStore.js +38 -0
  119. package/dist/adaptercloud/store/adaptercloudStore.js.map +1 -0
  120. package/dist/adaptercloud/store/index.js +1 -0
  121. package/dist/adaptercloud/utils/cn.js +10 -0
  122. package/dist/adaptercloud/utils/cn.js.map +1 -0
  123. package/dist/adaptercloud/utils/formatters.js +51 -0
  124. package/dist/adaptercloud/utils/formatters.js.map +1 -0
  125. package/dist/adaptercloud/utils/navigation.js +9 -0
  126. package/dist/adaptercloud/utils/navigation.js.map +1 -0
  127. package/dist/index.js +7 -0
  128. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +18 -0
  129. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +1 -0
  130. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
  131. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  132. package/package.json +106 -0
@@ -0,0 +1,606 @@
1
+ import { useAdapterCloud as e } from "../../context/AdapterCloudContext.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 { 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
+ //#region src/adaptercloud/pages/customer/ReviewsPage.tsx
11
+ var y = "user-001", b = {
12
+ 1: "Terrible",
13
+ 2: "Poor",
14
+ 3: "Average",
15
+ 4: "Good",
16
+ 5: "Excellent"
17
+ }, x = [
18
+ {
19
+ id: "review-001",
20
+ userId: y,
21
+ userName: "Rahul Sharma",
22
+ userAvatar: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100",
23
+ itemId: "FOOD-001",
24
+ itemName: "Dosa Express",
25
+ itemType: "cart",
26
+ cartId: "FOOD-001",
27
+ cartName: "Dosa Express",
28
+ orderId: "ORD-2024-001",
29
+ rating: 5,
30
+ title: "Excellent breakfast spot!",
31
+ comment: "Amazing dosas and filter coffee. The masala dosa was perfectly crispy and the potato filling was delicious. Service was quick and friendly. Highly recommend for authentic South Indian breakfast!",
32
+ helpfulCount: 12,
33
+ isHelpful: !0,
34
+ isVerified: !0,
35
+ createdAt: "2024-06-20T09:30:00Z",
36
+ response: {
37
+ message: "Thank you so much for your wonderful review! We're thrilled you enjoyed the dosas. We look forward to serving you again soon!",
38
+ respondedBy: "Dosa Express Team",
39
+ respondedAt: "2024-06-20T15:45:00Z"
40
+ }
41
+ },
42
+ {
43
+ id: "review-002",
44
+ userId: "user-002",
45
+ userName: "Priya Patel",
46
+ userAvatar: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=100",
47
+ itemId: "prod-002",
48
+ itemName: "Pani Puri",
49
+ itemType: "product",
50
+ cartId: "FOOD-002",
51
+ cartName: "Chaat Corner",
52
+ orderId: "ORD-2024-002",
53
+ rating: 4,
54
+ title: "Good but could be spicier",
55
+ comment: "The pani puri was good overall. The puris were crispy and fresh. However, the pani could have been more spicy and tangy. The portions were generous though.",
56
+ helpfulCount: 8,
57
+ isHelpful: !1,
58
+ isVerified: !0,
59
+ createdAt: "2024-06-18T19:15:00Z"
60
+ },
61
+ {
62
+ id: "review-003",
63
+ userId: "user-003",
64
+ userName: "Amit Kumar",
65
+ userAvatar: "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=100",
66
+ itemId: "FOOD-002",
67
+ itemName: "Chaat Corner",
68
+ itemType: "cart",
69
+ cartId: "FOOD-002",
70
+ cartName: "Chaat Corner",
71
+ orderId: "ORD-2024-003",
72
+ rating: 5,
73
+ title: "Authentic Mumbai street food!",
74
+ comment: "This place brings back memories of Mumbai streets. Every item I ordered was authentic and delicious. The bhel puri and vada pav were exceptional. Will definitely order again!",
75
+ images: ["https://images.unsplash.com/photo-1601050690597-df0568f70950?w=400"],
76
+ helpfulCount: 15,
77
+ isHelpful: !1,
78
+ isVerified: !0,
79
+ createdAt: "2024-06-17T20:30:00Z"
80
+ },
81
+ {
82
+ id: "review-004",
83
+ userId: y,
84
+ userName: "Rahul Sharma",
85
+ userAvatar: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100",
86
+ itemId: "prod-001",
87
+ itemName: "Masala Dosa",
88
+ itemType: "product",
89
+ cartId: "FOOD-001",
90
+ cartName: "Dosa Express",
91
+ orderId: "ORD-2024-004",
92
+ rating: 5,
93
+ title: "Perfect masala dosa!",
94
+ comment: "The masala dosa here is absolutely perfect. Crispy, golden brown, and the potato masala inside is perfectly spiced. Comes with great chutneys and sambar.",
95
+ helpfulCount: 6,
96
+ isHelpful: !1,
97
+ isVerified: !0,
98
+ createdAt: "2024-06-15T08:45:00Z",
99
+ response: {
100
+ message: "Glad you loved it, Rahul! Our chef takes great care with every dosa. See you soon!",
101
+ respondedBy: "Dosa Express Team",
102
+ respondedAt: "2024-06-15T14:00:00Z"
103
+ }
104
+ },
105
+ {
106
+ id: "review-005",
107
+ userId: "user-004",
108
+ userName: "Sneha Reddy",
109
+ userAvatar: "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=100",
110
+ itemId: "FOOD-001",
111
+ itemName: "Dosa Express",
112
+ itemType: "cart",
113
+ cartId: "FOOD-001",
114
+ cartName: "Dosa Express",
115
+ orderId: "ORD-2024-005",
116
+ rating: 3,
117
+ title: "Average experience",
118
+ comment: "The food was okay but delivery took longer than expected. The taste was good but not exceptional. The packaging could be better to keep food warm.",
119
+ helpfulCount: 4,
120
+ isHelpful: !1,
121
+ isVerified: !0,
122
+ createdAt: "2024-06-12T12:20:00Z"
123
+ }
124
+ ];
125
+ function S({ value: e, onChange: n }) {
126
+ let [r, i] = s(0), a = r || e;
127
+ return /* @__PURE__ */ v("div", {
128
+ className: "flex items-center gap-3",
129
+ children: [/* @__PURE__ */ _("div", {
130
+ className: "flex items-center gap-0.5",
131
+ children: [
132
+ 1,
133
+ 2,
134
+ 3,
135
+ 4,
136
+ 5
137
+ ].map((e) => /* @__PURE__ */ _("button", {
138
+ type: "button",
139
+ onClick: () => n(e),
140
+ onMouseEnter: () => i(e),
141
+ onMouseLeave: () => i(0),
142
+ className: "p-0.5 transition-transform hover:scale-110",
143
+ children: /* @__PURE__ */ _(m, { className: t("h-6 w-6", e <= a ? "fill-yellow-400 text-yellow-400" : "fill-none text-muted-foreground/40") })
144
+ }, e))
145
+ }), /* @__PURE__ */ _("span", {
146
+ className: "text-sm font-medium text-muted-foreground",
147
+ children: b[a] ?? ""
148
+ })]
149
+ });
150
+ }
151
+ function C() {
152
+ let { navigateTo: b } = e(), [C, w] = s(x), [T, E] = s(!1), [D, O] = s({
153
+ rating: 5,
154
+ title: "",
155
+ comment: ""
156
+ }), [k, A] = s({
157
+ searchQuery: "",
158
+ type: "all",
159
+ rating: "",
160
+ sortBy: "recent"
161
+ }), [j, M] = s(null), N = (e) => {
162
+ M(e), setTimeout(() => M(null), 3e3);
163
+ }, P = o(() => {
164
+ let e = [...C];
165
+ if (k.type === "my-reviews" ? e = e.filter((e) => e.userId === y) : k.type !== "all" && (e = e.filter((e) => e.itemType === k.type)), k.rating) {
166
+ let t = parseInt(k.rating, 10);
167
+ e = e.filter((e) => e.rating === t);
168
+ }
169
+ if (k.searchQuery) {
170
+ let t = k.searchQuery.toLowerCase();
171
+ e = e.filter((e) => e.itemName.toLowerCase().includes(t) || e.title.toLowerCase().includes(t) || e.comment.toLowerCase().includes(t) || e.cartName.toLowerCase().includes(t));
172
+ }
173
+ switch (k.sortBy) {
174
+ case "recent":
175
+ e.sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime());
176
+ break;
177
+ case "helpful":
178
+ e.sort((e, t) => t.helpfulCount - e.helpfulCount);
179
+ break;
180
+ case "rating-high":
181
+ e.sort((e, t) => t.rating - e.rating);
182
+ break;
183
+ case "rating-low":
184
+ e.sort((e, t) => e.rating - t.rating);
185
+ break;
186
+ }
187
+ return e;
188
+ }, [C, k])(), F = C.filter((e) => e.userId === y).length, I = C.length > 0 ? (C.reduce((e, t) => e + t.rating, 0) / C.length).toFixed(1) : "0", L = () => {
189
+ if (!D.title.trim() || !D.comment.trim()) {
190
+ alert("Please fill in the Review Title and Comment.");
191
+ return;
192
+ }
193
+ let e = {
194
+ id: `review-${Date.now()}`,
195
+ userId: y,
196
+ userName: "Rahul Sharma",
197
+ userAvatar: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=100",
198
+ itemId: "FOOD-001",
199
+ itemName: "Dosa Express",
200
+ itemType: "cart",
201
+ cartId: "FOOD-001",
202
+ cartName: "Dosa Express",
203
+ orderId: `ORD-2024-${Date.now()}`,
204
+ rating: D.rating,
205
+ title: D.title,
206
+ comment: D.comment,
207
+ helpfulCount: 0,
208
+ isHelpful: !1,
209
+ isVerified: !0,
210
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
211
+ };
212
+ w((t) => [e, ...t]), O({
213
+ rating: 5,
214
+ title: "",
215
+ comment: ""
216
+ }), E(!1), N("Review submitted successfully!");
217
+ }, R = (e) => {
218
+ w((t) => t.map((t) => t.id === e ? {
219
+ ...t,
220
+ isHelpful: !t.isHelpful,
221
+ helpfulCount: t.isHelpful ? t.helpfulCount - 1 : t.helpfulCount + 1
222
+ } : t));
223
+ };
224
+ return /* @__PURE__ */ v(n, {
225
+ title: "Reviews & Ratings",
226
+ description: `${P.length} reviews found`,
227
+ actions: /* @__PURE__ */ v("button", {
228
+ type: "button",
229
+ onClick: () => E(!0),
230
+ 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"),
231
+ children: [/* @__PURE__ */ _(f, { className: "h-4 w-4" }), "Write Review"]
232
+ }),
233
+ children: [
234
+ j && /* @__PURE__ */ v("div", {
235
+ className: "mb-4 rounded-lg border border-green-500/30 bg-green-500/10 p-3 flex items-center gap-2",
236
+ children: [/* @__PURE__ */ _(c, { className: "h-4 w-4 text-green-600 dark:text-green-400 shrink-0" }), /* @__PURE__ */ _("p", {
237
+ className: "text-sm text-green-600 dark:text-green-400",
238
+ children: j
239
+ })]
240
+ }),
241
+ /* @__PURE__ */ v("div", {
242
+ className: "flex flex-wrap items-center gap-4 text-sm text-muted-foreground mb-6",
243
+ children: [
244
+ /* @__PURE__ */ v("span", { children: [C.length, " total reviews"] }),
245
+ /* @__PURE__ */ v("span", { children: [F, " your reviews"] }),
246
+ /* @__PURE__ */ v("span", {
247
+ className: "flex items-center gap-1",
248
+ children: [
249
+ "Average: ",
250
+ I,
251
+ /* @__PURE__ */ _(m, { className: "h-3.5 w-3.5 fill-yellow-400 text-yellow-400" })
252
+ ]
253
+ })
254
+ ]
255
+ }),
256
+ /* @__PURE__ */ _("div", {
257
+ className: "rounded-lg border border-border bg-card p-4 mb-6",
258
+ children: /* @__PURE__ */ v("div", {
259
+ className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",
260
+ children: [
261
+ /* @__PURE__ */ v("div", {
262
+ className: "relative",
263
+ children: [/* @__PURE__ */ _(p, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ _("input", {
264
+ type: "text",
265
+ placeholder: "Search reviews...",
266
+ value: k.searchQuery,
267
+ onChange: (e) => A((t) => ({
268
+ ...t,
269
+ searchQuery: e.target.value
270
+ })),
271
+ className: "w-full rounded-lg border border-border bg-card py-2 pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
272
+ })]
273
+ }),
274
+ /* @__PURE__ */ v("select", {
275
+ value: k.type,
276
+ onChange: (e) => A((t) => ({
277
+ ...t,
278
+ type: e.target.value
279
+ })),
280
+ className: "w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",
281
+ children: [
282
+ /* @__PURE__ */ _("option", {
283
+ value: "all",
284
+ children: "All Reviews"
285
+ }),
286
+ /* @__PURE__ */ _("option", {
287
+ value: "cart",
288
+ children: "Cart Reviews"
289
+ }),
290
+ /* @__PURE__ */ _("option", {
291
+ value: "product",
292
+ children: "Product Reviews"
293
+ }),
294
+ /* @__PURE__ */ _("option", {
295
+ value: "my-reviews",
296
+ children: "My Reviews"
297
+ })
298
+ ]
299
+ }),
300
+ /* @__PURE__ */ v("select", {
301
+ value: k.rating,
302
+ onChange: (e) => A((t) => ({
303
+ ...t,
304
+ rating: e.target.value
305
+ })),
306
+ className: "w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",
307
+ children: [
308
+ /* @__PURE__ */ _("option", {
309
+ value: "",
310
+ children: "All Ratings"
311
+ }),
312
+ /* @__PURE__ */ _("option", {
313
+ value: "5",
314
+ children: "5 Stars"
315
+ }),
316
+ /* @__PURE__ */ _("option", {
317
+ value: "4",
318
+ children: "4 Stars"
319
+ }),
320
+ /* @__PURE__ */ _("option", {
321
+ value: "3",
322
+ children: "3 Stars"
323
+ }),
324
+ /* @__PURE__ */ _("option", {
325
+ value: "2",
326
+ children: "2 Stars"
327
+ }),
328
+ /* @__PURE__ */ _("option", {
329
+ value: "1",
330
+ children: "1 Star"
331
+ })
332
+ ]
333
+ }),
334
+ /* @__PURE__ */ v("select", {
335
+ value: k.sortBy,
336
+ onChange: (e) => A((t) => ({
337
+ ...t,
338
+ sortBy: e.target.value
339
+ })),
340
+ className: "w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",
341
+ children: [
342
+ /* @__PURE__ */ _("option", {
343
+ value: "recent",
344
+ children: "Most Recent"
345
+ }),
346
+ /* @__PURE__ */ _("option", {
347
+ value: "helpful",
348
+ children: "Most Helpful"
349
+ }),
350
+ /* @__PURE__ */ _("option", {
351
+ value: "rating-high",
352
+ children: "Highest Rating"
353
+ }),
354
+ /* @__PURE__ */ _("option", {
355
+ value: "rating-low",
356
+ children: "Lowest Rating"
357
+ })
358
+ ]
359
+ })
360
+ ]
361
+ })
362
+ }),
363
+ P.length === 0 ? /* @__PURE__ */ _(r, {
364
+ icon: /* @__PURE__ */ _(d, { className: "h-12 w-12" }),
365
+ title: "No reviews found",
366
+ description: "Be the first to write a review!",
367
+ action: /* @__PURE__ */ _("button", {
368
+ type: "button",
369
+ onClick: () => E(!0),
370
+ className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
371
+ children: "Write a Review"
372
+ })
373
+ }) : /* @__PURE__ */ _("div", {
374
+ className: "space-y-4",
375
+ children: P.map((e) => {
376
+ let n = e.userId === y;
377
+ return /* @__PURE__ */ v("div", {
378
+ className: t("rounded-lg border bg-card p-5", n ? "border-foreground/20" : "border-border"),
379
+ children: [
380
+ /* @__PURE__ */ v("div", {
381
+ className: "flex items-start gap-3 mb-3",
382
+ children: [
383
+ /* @__PURE__ */ _("img", {
384
+ src: e.userAvatar,
385
+ alt: e.userName,
386
+ className: "h-10 w-10 rounded-full object-cover shrink-0"
387
+ }),
388
+ /* @__PURE__ */ v("div", {
389
+ className: "flex-1 min-w-0",
390
+ children: [/* @__PURE__ */ v("div", {
391
+ className: "flex items-center gap-2 flex-wrap",
392
+ children: [
393
+ /* @__PURE__ */ _("span", {
394
+ className: "text-sm font-semibold text-foreground",
395
+ children: e.userName
396
+ }),
397
+ e.isVerified && /* @__PURE__ */ v("span", {
398
+ className: "inline-flex items-center gap-1 rounded-full bg-green-500/10 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",
399
+ children: [/* @__PURE__ */ _(c, { className: "h-3 w-3" }), "Verified"]
400
+ }),
401
+ n && /* @__PURE__ */ _("span", {
402
+ className: "inline-flex items-center rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-medium text-blue-600 dark:text-blue-400",
403
+ children: "Your Review"
404
+ })
405
+ ]
406
+ }), /* @__PURE__ */ v("div", {
407
+ className: "flex flex-wrap items-center gap-2 text-xs text-muted-foreground mt-0.5",
408
+ 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, {
409
+ hour: void 0,
410
+ minute: void 0,
411
+ hour12: void 0
412
+ }) })]
413
+ })]
414
+ }),
415
+ /* @__PURE__ */ v("div", {
416
+ className: "shrink-0",
417
+ children: [/* @__PURE__ */ _(a, {
418
+ value: e.rating,
419
+ size: "sm"
420
+ }), /* @__PURE__ */ v("p", {
421
+ className: "text-xs text-muted-foreground mt-0.5 text-right",
422
+ children: ["From: ", e.cartName]
423
+ })]
424
+ })
425
+ ]
426
+ }),
427
+ /* @__PURE__ */ v("div", {
428
+ className: "mb-3",
429
+ children: [/* @__PURE__ */ _("h4", {
430
+ className: "text-sm font-semibold text-foreground mb-1",
431
+ children: e.title
432
+ }), /* @__PURE__ */ _("p", {
433
+ className: "text-sm text-foreground leading-relaxed",
434
+ children: e.comment
435
+ })]
436
+ }),
437
+ e.images && e.images.length > 0 && /* @__PURE__ */ _("div", {
438
+ className: "mb-3 flex gap-2 overflow-x-auto pb-1",
439
+ children: e.images.map((e, t) => /* @__PURE__ */ _("img", {
440
+ src: e,
441
+ alt: `Review image ${t + 1}`,
442
+ className: "h-20 w-20 rounded-lg object-cover shrink-0"
443
+ }, t))
444
+ }),
445
+ e.response && /* @__PURE__ */ v("div", {
446
+ className: "mb-3 rounded-lg border border-blue-500/20 bg-blue-500/5 p-3",
447
+ children: [/* @__PURE__ */ v("div", {
448
+ className: "flex flex-wrap items-center gap-2 mb-1.5",
449
+ children: [
450
+ /* @__PURE__ */ _(u, { className: "h-3.5 w-3.5 text-blue-600 dark:text-blue-400" }),
451
+ /* @__PURE__ */ v("span", {
452
+ className: "text-xs font-medium text-blue-600 dark:text-blue-400",
453
+ children: ["Response from ", e.response.respondedBy]
454
+ }),
455
+ /* @__PURE__ */ _("span", {
456
+ className: "text-[10px] text-blue-500/70",
457
+ children: i(e.response.respondedAt, {
458
+ hour: void 0,
459
+ minute: void 0,
460
+ hour12: void 0
461
+ })
462
+ })
463
+ ]
464
+ }), /* @__PURE__ */ _("p", {
465
+ className: "text-xs text-blue-700 dark:text-blue-300 leading-relaxed",
466
+ children: e.response.message
467
+ })]
468
+ }),
469
+ /* @__PURE__ */ v("div", {
470
+ className: "flex items-center justify-between pt-3 border-t border-border",
471
+ children: [/* @__PURE__ */ v("button", {
472
+ type: "button",
473
+ onClick: () => R(e.id),
474
+ className: t("flex items-center gap-1.5 text-xs transition-colors", e.isHelpful ? "text-blue-600 dark:text-blue-400 font-medium" : "text-muted-foreground hover:text-foreground"),
475
+ children: [
476
+ /* @__PURE__ */ _(h, { className: t("h-3.5 w-3.5", e.isHelpful && "fill-current") }),
477
+ "Helpful (",
478
+ e.helpfulCount,
479
+ ")"
480
+ ]
481
+ }), /* @__PURE__ */ v("div", {
482
+ className: "flex items-center gap-3 text-xs text-muted-foreground",
483
+ children: [/* @__PURE__ */ v("span", { children: ["Order: ", e.orderId] }), /* @__PURE__ */ _("button", {
484
+ type: "button",
485
+ onClick: () => b(`/customer/carts/${e.cartId}`),
486
+ className: "font-medium hover:text-foreground transition-colors",
487
+ children: "View Cart"
488
+ })]
489
+ })]
490
+ })
491
+ ]
492
+ }, e.id);
493
+ })
494
+ }),
495
+ T && /* @__PURE__ */ _("div", {
496
+ className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
497
+ children: /* @__PURE__ */ _("div", {
498
+ className: "w-full max-w-2xl max-h-[90vh] overflow-y-auto rounded-lg border border-border bg-card shadow-lg",
499
+ children: /* @__PURE__ */ v("div", {
500
+ className: "p-5",
501
+ children: [
502
+ /* @__PURE__ */ v("div", {
503
+ className: "flex items-center justify-between mb-5",
504
+ children: [/* @__PURE__ */ _("h3", {
505
+ className: "text-lg font-semibold text-foreground",
506
+ children: "Write a Review"
507
+ }), /* @__PURE__ */ _("button", {
508
+ type: "button",
509
+ onClick: () => E(!1),
510
+ className: "rounded-md p-2 text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",
511
+ children: /* @__PURE__ */ _(g, { className: "h-4 w-4" })
512
+ })]
513
+ }),
514
+ /* @__PURE__ */ v("div", {
515
+ className: "space-y-4",
516
+ children: [
517
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
518
+ className: "block text-sm font-medium text-foreground mb-2",
519
+ children: ["Rating ", /* @__PURE__ */ _("span", {
520
+ className: "text-red-500",
521
+ children: "*"
522
+ })]
523
+ }), /* @__PURE__ */ _(S, {
524
+ value: D.rating,
525
+ onChange: (e) => O((t) => ({
526
+ ...t,
527
+ rating: e
528
+ }))
529
+ })] }),
530
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
531
+ className: "block text-sm font-medium text-foreground mb-1.5",
532
+ children: ["Review Title ", /* @__PURE__ */ _("span", {
533
+ className: "text-red-500",
534
+ children: "*"
535
+ })]
536
+ }), /* @__PURE__ */ _("input", {
537
+ type: "text",
538
+ placeholder: "Summarize your experience",
539
+ value: D.title,
540
+ onChange: (e) => O((t) => ({
541
+ ...t,
542
+ title: e.target.value
543
+ })),
544
+ className: "w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
545
+ })] }),
546
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
547
+ className: "block text-sm font-medium text-foreground mb-1.5",
548
+ children: ["Your Review ", /* @__PURE__ */ _("span", {
549
+ className: "text-red-500",
550
+ children: "*"
551
+ })]
552
+ }), /* @__PURE__ */ _("textarea", {
553
+ rows: 5,
554
+ placeholder: "Share your experience with others...",
555
+ value: D.comment,
556
+ onChange: (e) => O((t) => ({
557
+ ...t,
558
+ comment: e.target.value
559
+ })),
560
+ className: "w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none"
561
+ })] }),
562
+ /* @__PURE__ */ v("div", {
563
+ className: "rounded-lg bg-muted p-4",
564
+ children: [/* @__PURE__ */ v("div", {
565
+ className: "flex items-center gap-2 mb-2",
566
+ children: [/* @__PURE__ */ _(l, { className: "h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ _("h4", {
567
+ className: "text-sm font-medium text-foreground",
568
+ children: "Review Guidelines"
569
+ })]
570
+ }), /* @__PURE__ */ v("ul", {
571
+ className: "text-xs text-muted-foreground space-y-1",
572
+ children: [
573
+ /* @__PURE__ */ _("li", { children: "- Be honest and helpful to other customers" }),
574
+ /* @__PURE__ */ _("li", { children: "- Focus on your experience with the food and service" }),
575
+ /* @__PURE__ */ _("li", { children: "- Avoid personal information or inappropriate content" }),
576
+ /* @__PURE__ */ _("li", { children: "- Reviews are public and cannot be deleted once submitted" })
577
+ ]
578
+ })]
579
+ })
580
+ ]
581
+ }),
582
+ /* @__PURE__ */ v("div", {
583
+ className: "flex items-center gap-3 pt-5",
584
+ children: [/* @__PURE__ */ _("button", {
585
+ type: "button",
586
+ onClick: L,
587
+ className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
588
+ children: "Submit Review"
589
+ }), /* @__PURE__ */ _("button", {
590
+ type: "button",
591
+ onClick: () => E(!1),
592
+ className: "rounded-lg border border-border px-4 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors",
593
+ children: "Cancel"
594
+ })]
595
+ })
596
+ ]
597
+ })
598
+ })
599
+ })
600
+ ]
601
+ });
602
+ }
603
+ //#endregion
604
+ export { C as ReviewsPage };
605
+
606
+ //# sourceMappingURL=ReviewsPage.js.map