@burdenoff/microfe-kadaikodi 2026.704.2 → 2026.704.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kadaikodi/KadaikodiRoutes.js +30 -26
- package/dist/kadaikodi/KadaikodiRoutes.js.map +1 -1
- package/dist/kadaikodi/hooks/useKadaikodiApi.js +76 -6
- package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +45 -107
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminDashboard.js +30 -32
- package/dist/kadaikodi/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js +137 -120
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +2 -2
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminSettingsPage.js +332 -276
- package/dist/kadaikodi/pages/admin/AdminSettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/CartManagementPage.js +278 -283
- package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/UserManagementPage.js +310 -366
- package/dist/kadaikodi/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js +105 -111
- package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js +290 -257
- package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +84 -70
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js +270 -228
- package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +194 -173
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js +202 -139
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.js +232 -0
- package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.js.map +1 -0
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +84 -79
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/HelpSupportPage.js +310 -317
- package/dist/kadaikodi/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/NotificationCenterPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/SettingsPage.js +502 -586
- package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js +243 -143
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDetailPage.js +4 -4
- package/dist/kadaikodi/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js +2 -2
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CheckoutPage.js +4 -4
- package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CustomerDashboard.js +6 -6
- package/dist/kadaikodi/pages/customer/CustomerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CustomerProfilePage.js +189 -199
- package/dist/kadaikodi/pages/customer/CustomerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js +6 -4
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/FavoritesPage.js +6 -6
- package/dist/kadaikodi/pages/customer/FavoritesPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderHistoryPage.js +4 -4
- package/dist/kadaikodi/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +409 -304
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/ReviewsPage.js +209 -162
- package/dist/kadaikodi/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorProfilePage.js +441 -514
- package/dist/kadaikodi/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +207 -186
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js +340 -272
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js +122 -75
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,25 +2,26 @@ 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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { useCreateReview as i, useOrders as a } from "../../hooks/useKadaikodiApi.js";
|
|
6
|
+
import { formatDate as o } from "../../utils/formatters.js";
|
|
7
|
+
import { RatingDisplay as s } from "../../components/RatingDisplay.js";
|
|
8
|
+
import { useCallback as c, useState as l } from "react";
|
|
9
|
+
import { CheckCircle2 as u, Info as d, MessageCircle as f, MessageSquare as p, PenSquare as m, Search as h, Star as g, ThumbsUp as _, X as v } from "lucide-react";
|
|
10
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
11
|
+
import { EmphasisPanel as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
|
|
11
12
|
//#region src/kadaikodi/pages/customer/ReviewsPage.tsx
|
|
12
|
-
var
|
|
13
|
+
var C = {
|
|
13
14
|
1: "Terrible",
|
|
14
15
|
2: "Poor",
|
|
15
16
|
3: "Average",
|
|
16
17
|
4: "Good",
|
|
17
18
|
5: "Excellent"
|
|
18
19
|
};
|
|
19
|
-
function
|
|
20
|
-
let [r, i] =
|
|
21
|
-
return /* @__PURE__ */
|
|
20
|
+
function w({ value: e, onChange: n }) {
|
|
21
|
+
let [r, i] = l(0), a = r || e;
|
|
22
|
+
return /* @__PURE__ */ b("div", {
|
|
22
23
|
className: "flex items-center gap-3",
|
|
23
|
-
children: [/* @__PURE__ */
|
|
24
|
+
children: [/* @__PURE__ */ y("div", {
|
|
24
25
|
className: "flex items-center gap-0.5",
|
|
25
26
|
children: [
|
|
26
27
|
1,
|
|
@@ -28,43 +29,43 @@ function S({ value: e, onChange: n }) {
|
|
|
28
29
|
3,
|
|
29
30
|
4,
|
|
30
31
|
5
|
|
31
|
-
].map((e) => /* @__PURE__ */
|
|
32
|
+
].map((e) => /* @__PURE__ */ y("button", {
|
|
32
33
|
type: "button",
|
|
33
34
|
onClick: () => n(e),
|
|
34
35
|
onMouseEnter: () => i(e),
|
|
35
36
|
onMouseLeave: () => i(0),
|
|
36
37
|
className: "p-0.5 transition-transform",
|
|
37
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ y(g, { className: t("h-6 w-6", e <= a ? "fill-status-warning-text text-status-warning-text" : "fill-none text-text-secondary/40") })
|
|
38
39
|
}, e))
|
|
39
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ y("span", {
|
|
40
41
|
className: "text-sm font-medium text-text-secondary",
|
|
41
|
-
children:
|
|
42
|
+
children: C[a] ?? ""
|
|
42
43
|
})]
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
let { navigateTo:
|
|
46
|
+
function T() {
|
|
47
|
+
let { navigateTo: C, currentUser: T } = e(), E = T?.id ?? "", { data: D = [] } = a({ customerId: T?.id }), O = i(), k = D.filter((e) => e.status === "delivered"), [A, j] = l([]), [M, N] = l(!1), [P, F] = l(""), [I, L] = l({
|
|
47
48
|
rating: 5,
|
|
48
49
|
title: "",
|
|
49
50
|
comment: ""
|
|
50
|
-
}), [
|
|
51
|
+
}), [R, z] = l({
|
|
51
52
|
searchQuery: "",
|
|
52
53
|
type: "all",
|
|
53
54
|
rating: "",
|
|
54
55
|
sortBy: "recent"
|
|
55
|
-
}), [
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
let e = [...
|
|
59
|
-
if (
|
|
60
|
-
let t = parseInt(
|
|
56
|
+
}), [B, V] = l(null), H = (e) => {
|
|
57
|
+
V(e), setTimeout(() => V(null), 3e3);
|
|
58
|
+
}, U = c(() => {
|
|
59
|
+
let e = [...A];
|
|
60
|
+
if (R.type === "my-reviews" ? e = e.filter((e) => e.userId === E) : R.type !== "all" && (e = e.filter((e) => e.itemType === R.type)), R.rating) {
|
|
61
|
+
let t = parseInt(R.rating, 10);
|
|
61
62
|
e = e.filter((e) => e.rating === t);
|
|
62
63
|
}
|
|
63
|
-
if (
|
|
64
|
-
let t =
|
|
64
|
+
if (R.searchQuery) {
|
|
65
|
+
let t = R.searchQuery.toLowerCase();
|
|
65
66
|
e = e.filter((e) => e.itemName.toLowerCase().includes(t) || e.title.toLowerCase().includes(t) || e.comment.toLowerCase().includes(t) || e.cartName.toLowerCase().includes(t));
|
|
66
67
|
}
|
|
67
|
-
switch (
|
|
68
|
+
switch (R.sortBy) {
|
|
68
69
|
case "recent":
|
|
69
70
|
e.sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime());
|
|
70
71
|
break;
|
|
@@ -79,161 +80,181 @@ function C() {
|
|
|
79
80
|
break;
|
|
80
81
|
}
|
|
81
82
|
return e;
|
|
82
|
-
}, [
|
|
83
|
-
if (!
|
|
84
|
-
|
|
83
|
+
}, [A, R])(), W = A.filter((e) => e.userId === E).length, G = A.length > 0 ? (A.reduce((e, t) => e + t.rating, 0) / A.length).toFixed(1) : "0", K = () => {
|
|
84
|
+
if (!P) {
|
|
85
|
+
H("Please choose which delivered order you want to review.");
|
|
85
86
|
return;
|
|
86
87
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
if (!I.title.trim() || !I.comment.trim()) {
|
|
89
|
+
H("Please fill in the Review Title and Comment.");
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
let e = k.find((e) => e.id === P);
|
|
93
|
+
if (!e || !T?.id) {
|
|
94
|
+
H("Could not find that order. Please try again.");
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
O.mutate({
|
|
98
|
+
providerId: e.cartId,
|
|
99
|
+
orderId: e.id,
|
|
100
|
+
customerId: T.id,
|
|
101
|
+
rating: I.rating,
|
|
102
|
+
review: `${I.title.trim()} — ${I.comment.trim()}`
|
|
103
|
+
}, {
|
|
104
|
+
onSuccess: () => {
|
|
105
|
+
L({
|
|
106
|
+
rating: 5,
|
|
107
|
+
title: "",
|
|
108
|
+
comment: ""
|
|
109
|
+
}), F(""), N(!1), H("Thanks! Your review has been posted to the cart.");
|
|
110
|
+
},
|
|
111
|
+
onError: () => H("Could not post your review. Please try again.")
|
|
112
|
+
});
|
|
113
|
+
}, q = (e) => {
|
|
114
|
+
j((t) => t.map((t) => t.id === e ? {
|
|
94
115
|
...t,
|
|
95
116
|
isHelpful: !t.isHelpful,
|
|
96
117
|
helpfulCount: t.isHelpful ? t.helpfulCount - 1 : t.helpfulCount + 1
|
|
97
118
|
} : t));
|
|
98
119
|
};
|
|
99
|
-
return /* @__PURE__ */
|
|
120
|
+
return /* @__PURE__ */ b(n, {
|
|
100
121
|
title: "Reviews & Ratings",
|
|
101
|
-
description: `${
|
|
102
|
-
actions: /* @__PURE__ */
|
|
122
|
+
description: `${U.length} reviews found`,
|
|
123
|
+
actions: /* @__PURE__ */ b("button", {
|
|
103
124
|
type: "button",
|
|
104
|
-
onClick: () =>
|
|
125
|
+
onClick: () => N(!0),
|
|
105
126
|
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__ */
|
|
127
|
+
children: [/* @__PURE__ */ y(m, { className: "h-4 w-4" }), "Write Review"]
|
|
107
128
|
}),
|
|
108
129
|
children: [
|
|
109
|
-
|
|
130
|
+
B && /* @__PURE__ */ b("div", {
|
|
110
131
|
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__ */
|
|
132
|
+
children: [/* @__PURE__ */ y(u, { className: "h-4 w-4 text-status-success-text shrink-0" }), /* @__PURE__ */ y("p", {
|
|
112
133
|
className: "text-sm text-status-success-text",
|
|
113
|
-
children:
|
|
134
|
+
children: B
|
|
114
135
|
})]
|
|
115
136
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ y(S, {
|
|
117
138
|
className: "mb-6",
|
|
118
139
|
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."
|
|
119
140
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ y(x, {
|
|
121
142
|
className: "mb-6",
|
|
122
|
-
children: /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ b("div", {
|
|
123
144
|
className: "flex flex-wrap items-center gap-4 text-sm text-text-secondary",
|
|
124
145
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ b("span", { children: [A.length, " total reviews"] }),
|
|
147
|
+
/* @__PURE__ */ b("span", { children: [W, " your reviews"] }),
|
|
148
|
+
/* @__PURE__ */ b("span", {
|
|
128
149
|
className: "flex items-center gap-1",
|
|
129
150
|
children: [
|
|
130
151
|
"Average: ",
|
|
131
|
-
|
|
132
|
-
/* @__PURE__ */
|
|
152
|
+
G,
|
|
153
|
+
/* @__PURE__ */ y(g, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" })
|
|
133
154
|
]
|
|
134
155
|
})
|
|
135
156
|
]
|
|
136
157
|
})
|
|
137
158
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ y("div", {
|
|
139
160
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 mb-6",
|
|
140
|
-
children: /* @__PURE__ */
|
|
161
|
+
children: /* @__PURE__ */ b("div", {
|
|
141
162
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",
|
|
142
163
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ b("div", {
|
|
144
165
|
className: "relative",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
166
|
+
children: [/* @__PURE__ */ y(h, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary" }), /* @__PURE__ */ y("input", {
|
|
146
167
|
type: "text",
|
|
147
168
|
placeholder: "Search reviews...",
|
|
148
|
-
value:
|
|
149
|
-
onChange: (e) =>
|
|
169
|
+
value: R.searchQuery,
|
|
170
|
+
onChange: (e) => z((t) => ({
|
|
150
171
|
...t,
|
|
151
172
|
searchQuery: e.target.value
|
|
152
173
|
})),
|
|
153
174
|
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
175
|
})]
|
|
155
176
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
value:
|
|
158
|
-
onChange: (e) =>
|
|
177
|
+
/* @__PURE__ */ b("select", {
|
|
178
|
+
value: R.type,
|
|
179
|
+
onChange: (e) => z((t) => ({
|
|
159
180
|
...t,
|
|
160
181
|
type: e.target.value
|
|
161
182
|
})),
|
|
162
183
|
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
184
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ y("option", {
|
|
165
186
|
value: "all",
|
|
166
187
|
children: "All Reviews"
|
|
167
188
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ y("option", {
|
|
169
190
|
value: "cart",
|
|
170
191
|
children: "Cart Reviews"
|
|
171
192
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ y("option", {
|
|
173
194
|
value: "product",
|
|
174
195
|
children: "Product Reviews"
|
|
175
196
|
}),
|
|
176
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ y("option", {
|
|
177
198
|
value: "my-reviews",
|
|
178
199
|
children: "My Reviews"
|
|
179
200
|
})
|
|
180
201
|
]
|
|
181
202
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
value:
|
|
184
|
-
onChange: (e) =>
|
|
203
|
+
/* @__PURE__ */ b("select", {
|
|
204
|
+
value: R.rating,
|
|
205
|
+
onChange: (e) => z((t) => ({
|
|
185
206
|
...t,
|
|
186
207
|
rating: e.target.value
|
|
187
208
|
})),
|
|
188
209
|
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
210
|
children: [
|
|
190
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ y("option", {
|
|
191
212
|
value: "",
|
|
192
213
|
children: "All Ratings"
|
|
193
214
|
}),
|
|
194
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ y("option", {
|
|
195
216
|
value: "5",
|
|
196
217
|
children: "5 Stars"
|
|
197
218
|
}),
|
|
198
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ y("option", {
|
|
199
220
|
value: "4",
|
|
200
221
|
children: "4 Stars"
|
|
201
222
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ y("option", {
|
|
203
224
|
value: "3",
|
|
204
225
|
children: "3 Stars"
|
|
205
226
|
}),
|
|
206
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ y("option", {
|
|
207
228
|
value: "2",
|
|
208
229
|
children: "2 Stars"
|
|
209
230
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ y("option", {
|
|
211
232
|
value: "1",
|
|
212
233
|
children: "1 Star"
|
|
213
234
|
})
|
|
214
235
|
]
|
|
215
236
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
value:
|
|
218
|
-
onChange: (e) =>
|
|
237
|
+
/* @__PURE__ */ b("select", {
|
|
238
|
+
value: R.sortBy,
|
|
239
|
+
onChange: (e) => z((t) => ({
|
|
219
240
|
...t,
|
|
220
241
|
sortBy: e.target.value
|
|
221
242
|
})),
|
|
222
243
|
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
244
|
children: [
|
|
224
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ y("option", {
|
|
225
246
|
value: "recent",
|
|
226
247
|
children: "Most Recent"
|
|
227
248
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ y("option", {
|
|
229
250
|
value: "helpful",
|
|
230
251
|
children: "Most Helpful"
|
|
231
252
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ y("option", {
|
|
233
254
|
value: "rating-high",
|
|
234
255
|
children: "Highest Rating"
|
|
235
256
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ y("option", {
|
|
237
258
|
value: "rating-low",
|
|
238
259
|
children: "Lowest Rating"
|
|
239
260
|
})
|
|
@@ -242,129 +263,129 @@ function C() {
|
|
|
242
263
|
]
|
|
243
264
|
})
|
|
244
265
|
}),
|
|
245
|
-
|
|
246
|
-
icon: /* @__PURE__ */
|
|
266
|
+
U.length === 0 ? /* @__PURE__ */ y(r, {
|
|
267
|
+
icon: /* @__PURE__ */ y(p, { className: "h-12 w-12" }),
|
|
247
268
|
title: "No reviews found",
|
|
248
269
|
description: "Be the first to write a review!",
|
|
249
|
-
action: /* @__PURE__ */
|
|
270
|
+
action: /* @__PURE__ */ y("button", {
|
|
250
271
|
type: "button",
|
|
251
|
-
onClick: () =>
|
|
272
|
+
onClick: () => N(!0),
|
|
252
273
|
className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
|
|
253
274
|
children: "Write a Review"
|
|
254
275
|
})
|
|
255
|
-
}) : /* @__PURE__ */
|
|
276
|
+
}) : /* @__PURE__ */ y("div", {
|
|
256
277
|
className: "space-y-4",
|
|
257
|
-
children:
|
|
258
|
-
let n = e.userId ===
|
|
259
|
-
return /* @__PURE__ */
|
|
278
|
+
children: U.map((e) => {
|
|
279
|
+
let n = e.userId === E;
|
|
280
|
+
return /* @__PURE__ */ b("div", {
|
|
260
281
|
className: t("rounded-lg border bg-bg-surface p-5", n ? "border-foreground/20" : "border-border-subtle"),
|
|
261
282
|
children: [
|
|
262
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ b("div", {
|
|
263
284
|
className: "flex items-start gap-3 mb-3",
|
|
264
285
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ y("img", {
|
|
266
287
|
src: e.userAvatar,
|
|
267
288
|
alt: e.userName,
|
|
268
289
|
className: "h-10 w-10 rounded-full object-cover shrink-0"
|
|
269
290
|
}),
|
|
270
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ b("div", {
|
|
271
292
|
className: "flex-1 min-w-0",
|
|
272
|
-
children: [/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ b("div", {
|
|
273
294
|
className: "flex items-center gap-2 flex-wrap",
|
|
274
295
|
children: [
|
|
275
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ y("span", {
|
|
276
297
|
className: "text-sm font-semibold text-text-primary",
|
|
277
298
|
children: e.userName
|
|
278
299
|
}),
|
|
279
|
-
e.isVerified && /* @__PURE__ */
|
|
300
|
+
e.isVerified && /* @__PURE__ */ b("span", {
|
|
280
301
|
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__ */
|
|
302
|
+
children: [/* @__PURE__ */ y(u, { className: "h-3 w-3" }), "Verified"]
|
|
282
303
|
}),
|
|
283
|
-
n && /* @__PURE__ */
|
|
304
|
+
n && /* @__PURE__ */ y("span", {
|
|
284
305
|
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
306
|
children: "Your Review"
|
|
286
307
|
})
|
|
287
308
|
]
|
|
288
|
-
}), /* @__PURE__ */
|
|
309
|
+
}), /* @__PURE__ */ b("div", {
|
|
289
310
|
className: "flex flex-wrap items-center gap-2 text-xs text-text-secondary mt-0.5",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ b("span", { children: [e.itemType === "cart" ? /* @__PURE__ */ y(p, { className: "inline h-3 w-3 mr-0.5" }) : /* @__PURE__ */ y(g, { className: "inline h-3 w-3 mr-0.5" }), e.itemName] }), /* @__PURE__ */ y("span", { children: o(e.createdAt, {
|
|
291
312
|
hour: void 0,
|
|
292
313
|
minute: void 0,
|
|
293
314
|
hour12: void 0
|
|
294
315
|
}) })]
|
|
295
316
|
})]
|
|
296
317
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ b("div", {
|
|
298
319
|
className: "shrink-0",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ y(s, {
|
|
300
321
|
value: e.rating,
|
|
301
322
|
size: "sm"
|
|
302
|
-
}), /* @__PURE__ */
|
|
323
|
+
}), /* @__PURE__ */ b("p", {
|
|
303
324
|
className: "text-xs text-text-secondary mt-0.5 text-right",
|
|
304
325
|
children: ["From: ", e.cartName]
|
|
305
326
|
})]
|
|
306
327
|
})
|
|
307
328
|
]
|
|
308
329
|
}),
|
|
309
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ b("div", {
|
|
310
331
|
className: "mb-3",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
332
|
+
children: [/* @__PURE__ */ y("h4", {
|
|
312
333
|
className: "text-sm font-semibold text-text-primary mb-1",
|
|
313
334
|
children: e.title
|
|
314
|
-
}), /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ y("p", {
|
|
315
336
|
className: "text-sm text-text-primary leading-relaxed",
|
|
316
337
|
children: e.comment
|
|
317
338
|
})]
|
|
318
339
|
}),
|
|
319
|
-
e.images && e.images.length > 0 && /* @__PURE__ */
|
|
340
|
+
e.images && e.images.length > 0 && /* @__PURE__ */ y("div", {
|
|
320
341
|
className: "mb-3 flex gap-2 overflow-x-auto pb-1",
|
|
321
|
-
children: e.images.map((e, t) => /* @__PURE__ */
|
|
342
|
+
children: e.images.map((e, t) => /* @__PURE__ */ y("img", {
|
|
322
343
|
src: e,
|
|
323
344
|
alt: `Review image ${t + 1}`,
|
|
324
345
|
className: "h-20 w-20 rounded-lg object-cover shrink-0"
|
|
325
346
|
}, t))
|
|
326
347
|
}),
|
|
327
|
-
e.response && /* @__PURE__ */
|
|
348
|
+
e.response && /* @__PURE__ */ b("div", {
|
|
328
349
|
className: "mb-3 rounded-lg border border-border-focus/20 bg-[var(--color-accent-soft)] p-3",
|
|
329
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ b("div", {
|
|
330
351
|
className: "flex flex-wrap items-center gap-2 mb-1.5",
|
|
331
352
|
children: [
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ y(f, { className: "h-3.5 w-3.5 text-text-primary" }),
|
|
354
|
+
/* @__PURE__ */ b("span", {
|
|
334
355
|
className: "text-xs font-medium text-text-primary",
|
|
335
356
|
children: ["Response from ", e.response.respondedBy]
|
|
336
357
|
}),
|
|
337
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ y("span", {
|
|
338
359
|
className: "text-[10px] text-text-primary/70",
|
|
339
|
-
children:
|
|
360
|
+
children: o(e.response.respondedAt, {
|
|
340
361
|
hour: void 0,
|
|
341
362
|
minute: void 0,
|
|
342
363
|
hour12: void 0
|
|
343
364
|
})
|
|
344
365
|
})
|
|
345
366
|
]
|
|
346
|
-
}), /* @__PURE__ */
|
|
367
|
+
}), /* @__PURE__ */ y("p", {
|
|
347
368
|
className: "text-xs text-text-primary leading-relaxed",
|
|
348
369
|
children: e.response.message
|
|
349
370
|
})]
|
|
350
371
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ b("div", {
|
|
352
373
|
className: "flex items-center justify-between pt-3 border-t border-border-subtle",
|
|
353
|
-
children: [/* @__PURE__ */
|
|
374
|
+
children: [/* @__PURE__ */ b("button", {
|
|
354
375
|
type: "button",
|
|
355
|
-
onClick: () =>
|
|
376
|
+
onClick: () => q(e.id),
|
|
356
377
|
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
378
|
children: [
|
|
358
|
-
/* @__PURE__ */ _
|
|
379
|
+
/* @__PURE__ */ y(_, { className: t("h-3.5 w-3.5", e.isHelpful && "fill-current") }),
|
|
359
380
|
"Helpful (",
|
|
360
381
|
e.helpfulCount,
|
|
361
382
|
")"
|
|
362
383
|
]
|
|
363
|
-
}), /* @__PURE__ */
|
|
384
|
+
}), /* @__PURE__ */ b("div", {
|
|
364
385
|
className: "flex items-center gap-3 text-xs text-text-secondary",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
386
|
+
children: [/* @__PURE__ */ b("span", { children: ["Order: ", e.orderId] }), /* @__PURE__ */ y("button", {
|
|
366
387
|
type: "button",
|
|
367
|
-
onClick: () =>
|
|
388
|
+
onClick: () => C(`/customer/cart/${e.cartId}`),
|
|
368
389
|
className: "font-medium hover:text-text-primary transition-colors",
|
|
369
390
|
children: "View Cart"
|
|
370
391
|
})]
|
|
@@ -374,103 +395,129 @@ function C() {
|
|
|
374
395
|
}, e.id);
|
|
375
396
|
})
|
|
376
397
|
}),
|
|
377
|
-
|
|
398
|
+
M && /* @__PURE__ */ y("div", {
|
|
378
399
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
|
|
379
|
-
children: /* @__PURE__ */
|
|
400
|
+
children: /* @__PURE__ */ y("div", {
|
|
380
401
|
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__ */
|
|
402
|
+
children: /* @__PURE__ */ b("div", {
|
|
382
403
|
className: "p-5",
|
|
383
404
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ b("div", {
|
|
385
406
|
className: "flex items-center justify-between mb-5",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
407
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
387
408
|
className: "text-lg font-semibold text-text-primary",
|
|
388
409
|
children: "Write a Review"
|
|
389
|
-
}), /* @__PURE__ */
|
|
410
|
+
}), /* @__PURE__ */ y("button", {
|
|
390
411
|
type: "button",
|
|
391
|
-
onClick: () =>
|
|
412
|
+
onClick: () => N(!1),
|
|
392
413
|
className: "rounded-md p-2 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors",
|
|
393
|
-
children: /* @__PURE__ */
|
|
414
|
+
children: /* @__PURE__ */ y(v, { className: "h-4 w-4" })
|
|
394
415
|
})]
|
|
395
416
|
}),
|
|
396
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ b("div", {
|
|
397
418
|
className: "space-y-4",
|
|
398
419
|
children: [
|
|
399
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("label", {
|
|
421
|
+
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
422
|
+
children: ["Which order? ", /* @__PURE__ */ y("span", {
|
|
423
|
+
className: "text-status-error-text",
|
|
424
|
+
children: "*"
|
|
425
|
+
})]
|
|
426
|
+
}), k.length > 0 ? /* @__PURE__ */ b("select", {
|
|
427
|
+
value: P,
|
|
428
|
+
onChange: (e) => F(e.target.value),
|
|
429
|
+
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)]",
|
|
430
|
+
children: [/* @__PURE__ */ y("option", {
|
|
431
|
+
value: "",
|
|
432
|
+
children: "Select a delivered order…"
|
|
433
|
+
}), k.map((e) => /* @__PURE__ */ b("option", {
|
|
434
|
+
value: e.id,
|
|
435
|
+
children: [
|
|
436
|
+
e.cartName,
|
|
437
|
+
" · ",
|
|
438
|
+
o(e.orderDate)
|
|
439
|
+
]
|
|
440
|
+
}, e.id))]
|
|
441
|
+
}) : /* @__PURE__ */ y("p", {
|
|
442
|
+
className: "rounded-lg bg-bg-sunken p-3 text-xs text-text-secondary",
|
|
443
|
+
children: "You can review a cart once one of your orders has been delivered. Place an order and come back after it arrives."
|
|
444
|
+
})] }),
|
|
445
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("label", {
|
|
400
446
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
401
|
-
children: ["Rating ", /* @__PURE__ */
|
|
447
|
+
children: ["Rating ", /* @__PURE__ */ y("span", {
|
|
402
448
|
className: "text-status-error-text",
|
|
403
449
|
children: "*"
|
|
404
450
|
})]
|
|
405
|
-
}), /* @__PURE__ */
|
|
406
|
-
value:
|
|
407
|
-
onChange: (e) =>
|
|
451
|
+
}), /* @__PURE__ */ y(w, {
|
|
452
|
+
value: I.rating,
|
|
453
|
+
onChange: (e) => L((t) => ({
|
|
408
454
|
...t,
|
|
409
455
|
rating: e
|
|
410
456
|
}))
|
|
411
457
|
})] }),
|
|
412
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("label", {
|
|
413
459
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
414
|
-
children: ["Review Title ", /* @__PURE__ */
|
|
460
|
+
children: ["Review Title ", /* @__PURE__ */ y("span", {
|
|
415
461
|
className: "text-status-error-text",
|
|
416
462
|
children: "*"
|
|
417
463
|
})]
|
|
418
|
-
}), /* @__PURE__ */
|
|
464
|
+
}), /* @__PURE__ */ y("input", {
|
|
419
465
|
type: "text",
|
|
420
466
|
placeholder: "Summarize your experience",
|
|
421
|
-
value:
|
|
422
|
-
onChange: (e) =>
|
|
467
|
+
value: I.title,
|
|
468
|
+
onChange: (e) => L((t) => ({
|
|
423
469
|
...t,
|
|
424
470
|
title: e.target.value
|
|
425
471
|
})),
|
|
426
472
|
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
473
|
})] }),
|
|
428
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("label", {
|
|
429
475
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
430
|
-
children: ["Your Review ", /* @__PURE__ */
|
|
476
|
+
children: ["Your Review ", /* @__PURE__ */ y("span", {
|
|
431
477
|
className: "text-status-error-text",
|
|
432
478
|
children: "*"
|
|
433
479
|
})]
|
|
434
|
-
}), /* @__PURE__ */
|
|
480
|
+
}), /* @__PURE__ */ y("textarea", {
|
|
435
481
|
rows: 5,
|
|
436
482
|
placeholder: "Share your experience with others...",
|
|
437
|
-
value:
|
|
438
|
-
onChange: (e) =>
|
|
483
|
+
value: I.comment,
|
|
484
|
+
onChange: (e) => L((t) => ({
|
|
439
485
|
...t,
|
|
440
486
|
comment: e.target.value
|
|
441
487
|
})),
|
|
442
488
|
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
489
|
})] }),
|
|
444
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ b("div", {
|
|
445
491
|
className: "rounded-lg bg-bg-sunken p-4",
|
|
446
|
-
children: [/* @__PURE__ */
|
|
492
|
+
children: [/* @__PURE__ */ b("div", {
|
|
447
493
|
className: "flex items-center gap-2 mb-2",
|
|
448
|
-
children: [/* @__PURE__ */
|
|
494
|
+
children: [/* @__PURE__ */ y(d, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ y("h4", {
|
|
449
495
|
className: "text-sm font-medium text-text-primary",
|
|
450
496
|
children: "Review Guidelines"
|
|
451
497
|
})]
|
|
452
|
-
}), /* @__PURE__ */
|
|
498
|
+
}), /* @__PURE__ */ b("ul", {
|
|
453
499
|
className: "text-xs text-text-secondary space-y-1",
|
|
454
500
|
children: [
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ y("li", { children: "- Be honest and helpful to other customers" }),
|
|
502
|
+
/* @__PURE__ */ y("li", { children: "- Focus on your experience with the food and service" }),
|
|
503
|
+
/* @__PURE__ */ y("li", { children: "- Avoid personal information or inappropriate content" }),
|
|
504
|
+
/* @__PURE__ */ y("li", { children: "- Reviews are public and cannot be deleted once submitted" })
|
|
459
505
|
]
|
|
460
506
|
})]
|
|
461
507
|
})
|
|
462
508
|
]
|
|
463
509
|
}),
|
|
464
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ b("div", {
|
|
465
511
|
className: "flex items-center gap-3 pt-5",
|
|
466
|
-
children: [/* @__PURE__ */
|
|
512
|
+
children: [/* @__PURE__ */ y("button", {
|
|
467
513
|
type: "button",
|
|
468
|
-
onClick:
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
514
|
+
onClick: K,
|
|
515
|
+
disabled: O.isPending || k.length === 0,
|
|
516
|
+
className: t("rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background transition-opacity", O.isPending || k.length === 0 ? "opacity-60 cursor-not-allowed" : "hover:opacity-90"),
|
|
517
|
+
children: O.isPending ? "Posting…" : "Submit Review"
|
|
518
|
+
}), /* @__PURE__ */ y("button", {
|
|
472
519
|
type: "button",
|
|
473
|
-
onClick: () =>
|
|
520
|
+
onClick: () => N(!1),
|
|
474
521
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
475
522
|
children: "Cancel"
|
|
476
523
|
})]
|
|
@@ -483,6 +530,6 @@ function C() {
|
|
|
483
530
|
});
|
|
484
531
|
}
|
|
485
532
|
//#endregion
|
|
486
|
-
export {
|
|
533
|
+
export { T as ReviewsPage };
|
|
487
534
|
|
|
488
535
|
//# sourceMappingURL=ReviewsPage.js.map
|