@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,14 +2,14 @@ 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 {
|
|
5
|
+
import { useCreateOffering as i, useDeleteOffering as ee, useOfferings as te, useProviders as ne, useUpdateOffering as re } from "../../hooks/useKadaikodiApi.js";
|
|
6
6
|
import { formatCurrency as a } from "../../utils/formatters.js";
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { AlertCircle as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { EmphasisPanel as
|
|
7
|
+
import { useEffect as ie, useMemo as o, useState as s } from "react";
|
|
8
|
+
import { AlertCircle as ae, CheckCircle2 as oe, Download as se, Edit2 as ce, Package as c, Plus as l, Search as le, Trash2 as ue, Upload as de, X as fe } from "lucide-react";
|
|
9
|
+
import { Fragment as pe, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
+
import { EmphasisPanel as me, PagePurpose as he } from "@burdenoff/fe-libs/ui";
|
|
11
11
|
//#region src/kadaikodi/pages/cart-owner/InventoryManagementPage.tsx
|
|
12
|
-
var
|
|
12
|
+
var ge = [
|
|
13
13
|
"Service",
|
|
14
14
|
"Repair",
|
|
15
15
|
"Beauty",
|
|
@@ -18,7 +18,7 @@ var pe = [
|
|
|
18
18
|
"Health",
|
|
19
19
|
"Wellness",
|
|
20
20
|
"Education"
|
|
21
|
-
], f = (e) =>
|
|
21
|
+
], f = (e) => ge.some((t) => e.includes(t)), _e = (e) => e === "Food & Beverage", p = {
|
|
22
22
|
FOOD_BEVERAGE: "Food & Beverage",
|
|
23
23
|
PERSONAL_CARE_BEAUTY: "Personal Care & Beauty",
|
|
24
24
|
CLOTHING_FASHION: "Clothing & Fashion",
|
|
@@ -28,7 +28,10 @@ var pe = [
|
|
|
28
28
|
EDUCATION_SKILLS: "Education & Skills",
|
|
29
29
|
RETAIL_MERCHANDISE: "Retail & Merchandise",
|
|
30
30
|
GROCERY_ESSENTIALS: "Grocery & Essentials"
|
|
31
|
-
},
|
|
31
|
+
}, ve = Object.fromEntries(Object.entries(p).map(([e, t]) => [t, e])), ye = Object.values(p).sort(), be = (e) => `${e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "offering"}-${Date.now().toString(36)}`, xe = (e) => {
|
|
32
|
+
let t = String(e ?? "");
|
|
33
|
+
return /[",\n]/.test(t) ? `"${t.replace(/"/g, "\"\"")}"` : t;
|
|
34
|
+
}, Se = (e, t) => ({
|
|
32
35
|
id: e.id,
|
|
33
36
|
name: e.name,
|
|
34
37
|
description: e.description ?? "",
|
|
@@ -69,17 +72,17 @@ var pe = [
|
|
|
69
72
|
serviceType: "instant",
|
|
70
73
|
requirements: []
|
|
71
74
|
}, h = () => {
|
|
72
|
-
let { navigateTo:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
let [
|
|
77
|
-
let e = [...
|
|
78
|
-
if (
|
|
79
|
-
let t =
|
|
75
|
+
let { navigateTo: ge, currentUser: p } = e(), { data: h = [] } = ne(), g = o(() => h.find((e) => e.ownerId === p?.id) ?? h[0], [h, p?.id]), _ = g?.id, { data: v = [], isLoading: Ce } = te(_), y = re(), we = i(), Te = ee(), [b, x] = s([]);
|
|
76
|
+
ie(() => {
|
|
77
|
+
x(v.map((e) => Se(e, g?.name ?? "")));
|
|
78
|
+
}, [v, g?.name]);
|
|
79
|
+
let [S, C] = s(""), [w, T] = s(""), [E, D] = s(""), [O, k] = s("name"), [Ee, De] = s(!1), [Oe, A] = s(!1), [j, M] = s(null), [N, P] = s(m), [F, I] = s(""), [L, R] = s(""), [z, B] = s(""), [V, H] = s(null), ke = o(() => [...new Set(b.map((e) => e.category))].sort(), [b]), U = o(() => {
|
|
80
|
+
let e = [...b];
|
|
81
|
+
if (S) {
|
|
82
|
+
let t = S.toLowerCase();
|
|
80
83
|
e = e.filter((e) => e.name.toLowerCase().includes(t) || e.description.toLowerCase().includes(t) || e.category.toLowerCase().includes(t) || e.tags.some((e) => e.toLowerCase().includes(t)));
|
|
81
84
|
}
|
|
82
|
-
switch (
|
|
85
|
+
switch (w && (e = e.filter((e) => e.category === w)), E === "available" ? e = e.filter((e) => e.isAvailable) : E === "unavailable" && (e = e.filter((e) => !e.isAvailable)), O) {
|
|
83
86
|
case "name":
|
|
84
87
|
e.sort((e, t) => e.name.localeCompare(t.name));
|
|
85
88
|
break;
|
|
@@ -95,23 +98,23 @@ var pe = [
|
|
|
95
98
|
}
|
|
96
99
|
return e;
|
|
97
100
|
}, [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
]),
|
|
104
|
-
|
|
101
|
+
b,
|
|
102
|
+
S,
|
|
103
|
+
w,
|
|
104
|
+
E,
|
|
105
|
+
O
|
|
106
|
+
]), Ae = b.length, je = b.filter((e) => e.isAvailable).length, Me = b.filter((e) => !f(e.category) && e.stock === 0).length, Ne = b.filter((e) => !f(e.category) && e.stock > 0 && e.stock < 10).length, W = (e, t) => {
|
|
107
|
+
H({
|
|
105
108
|
text: e,
|
|
106
109
|
type: t
|
|
107
|
-
}), setTimeout(() =>
|
|
110
|
+
}), setTimeout(() => H(null), 3e3);
|
|
108
111
|
}, G = () => {
|
|
109
|
-
|
|
112
|
+
M(null), P({
|
|
110
113
|
...m,
|
|
111
|
-
category:
|
|
112
|
-
}),
|
|
114
|
+
category: ""
|
|
115
|
+
}), I(""), R(""), B(""), A(!0);
|
|
113
116
|
}, K = (e) => {
|
|
114
|
-
|
|
117
|
+
M(e), P({
|
|
115
118
|
name: e.name,
|
|
116
119
|
description: e.description,
|
|
117
120
|
category: e.category,
|
|
@@ -130,64 +133,115 @@ var pe = [
|
|
|
130
133
|
duration: e.duration,
|
|
131
134
|
serviceType: e.serviceType,
|
|
132
135
|
requirements: e.requirements
|
|
133
|
-
}),
|
|
134
|
-
},
|
|
135
|
-
if (!
|
|
136
|
+
}), I(e.tags.join(", ")), R(e.allergens.join(", ")), B(e.requirements.join(", ")), A(!0);
|
|
137
|
+
}, Pe = () => {
|
|
138
|
+
if (!N.name || !N.description || !N.category || N.price <= 0) {
|
|
136
139
|
W("Please fill all required fields (name, description, category, price > 0)", "error");
|
|
137
140
|
return;
|
|
138
141
|
}
|
|
139
|
-
let e =
|
|
140
|
-
if (
|
|
142
|
+
let e = F.split(",").map((e) => e.trim()).filter(Boolean), t = L.split(",").map((e) => e.trim()).filter(Boolean), n = z.split(",").map((e) => e.trim()).filter(Boolean), r = f(N.category), i = r ? "Service" : "Product";
|
|
143
|
+
if (j) x((r) => r.map((r) => r.id === j.id ? {
|
|
141
144
|
...r,
|
|
142
|
-
...
|
|
145
|
+
...N,
|
|
143
146
|
tags: e,
|
|
144
147
|
allergens: t,
|
|
145
148
|
requirements: n
|
|
146
|
-
} : r)),
|
|
147
|
-
id:
|
|
149
|
+
} : r)), y.mutate({
|
|
150
|
+
id: j.id,
|
|
148
151
|
input: {
|
|
149
|
-
name:
|
|
150
|
-
description:
|
|
151
|
-
price:
|
|
152
|
-
originalPrice:
|
|
153
|
-
stock:
|
|
152
|
+
name: N.name,
|
|
153
|
+
description: N.description,
|
|
154
|
+
price: N.price,
|
|
155
|
+
originalPrice: N.originalPrice,
|
|
156
|
+
stock: r ? void 0 : N.stock,
|
|
154
157
|
tags: e,
|
|
155
|
-
serviceType:
|
|
156
|
-
durationMinutes: r ?
|
|
158
|
+
serviceType: N.serviceType || void 0,
|
|
159
|
+
durationMinutes: r ? N.duration : void 0
|
|
157
160
|
}
|
|
158
|
-
}, { onError: () => W("Could not save changes to the server", "error") }), W(`${i} updated successfully`, "success");
|
|
161
|
+
}, { onError: () => W("Could not save changes to the server", "error") }), W(`${i} updated successfully`, "success"), A(!1);
|
|
159
162
|
else {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
if (!_) {
|
|
164
|
+
W("Create your cart before adding offerings", "error");
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
let t = ve[N.category];
|
|
168
|
+
if (!t) {
|
|
169
|
+
W("Please choose a valid category", "error");
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
we.mutate({
|
|
173
|
+
providerId: _,
|
|
174
|
+
name: N.name,
|
|
175
|
+
slug: be(N.name),
|
|
176
|
+
description: N.description,
|
|
177
|
+
category: t,
|
|
178
|
+
kind: r ? "SERVICE" : "PRODUCT",
|
|
179
|
+
price: N.price,
|
|
180
|
+
originalPrice: N.originalPrice,
|
|
181
|
+
stock: r ? void 0 : N.stock,
|
|
163
182
|
tags: e,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
183
|
+
serviceType: r && N.serviceType || void 0,
|
|
184
|
+
durationMinutes: r ? N.duration : void 0
|
|
185
|
+
}, {
|
|
186
|
+
onSuccess: () => {
|
|
187
|
+
W(`${i} added successfully`, "success"), A(!1);
|
|
188
|
+
},
|
|
189
|
+
onError: () => W(`Could not create the ${i.toLowerCase()}`, "error")
|
|
190
|
+
});
|
|
169
191
|
}
|
|
170
|
-
k(!1);
|
|
171
192
|
}, q = (e) => {
|
|
172
|
-
confirm("Are you sure you want to delete this offering?")
|
|
193
|
+
if (!confirm("Are you sure you want to delete this offering?")) return;
|
|
194
|
+
let t = b;
|
|
195
|
+
x((t) => t.filter((t) => t.id !== e)), Te.mutate(e, {
|
|
196
|
+
onSuccess: () => W("Offering deleted successfully", "success"),
|
|
197
|
+
onError: () => {
|
|
198
|
+
x(t), W("Could not delete the offering", "error");
|
|
199
|
+
}
|
|
200
|
+
});
|
|
173
201
|
}, J = (e, t) => {
|
|
174
|
-
|
|
202
|
+
x((n) => n.map((n) => n.id === e ? {
|
|
175
203
|
...n,
|
|
176
204
|
isAvailable: t
|
|
177
|
-
} : n)),
|
|
205
|
+
} : n)), y.mutate({
|
|
178
206
|
id: e,
|
|
179
207
|
input: { isAvailable: t }
|
|
180
208
|
}, { onError: () => W("Could not update availability on the server", "error") }), W(`Offering ${t ? "enabled" : "disabled"} successfully`, "success");
|
|
181
209
|
}, Y = (e) => {
|
|
182
|
-
let t = e === "enable", n =
|
|
183
|
-
if (n === 0) {
|
|
210
|
+
let t = e === "enable", n = b.filter((e) => e.isAvailable !== t);
|
|
211
|
+
if (n.length === 0) {
|
|
184
212
|
W(`No offerings to ${e}`, "error");
|
|
185
213
|
return;
|
|
186
214
|
}
|
|
187
|
-
|
|
215
|
+
x((e) => e.map((e) => ({
|
|
188
216
|
...e,
|
|
189
217
|
isAvailable: t
|
|
190
|
-
}))),
|
|
218
|
+
}))), n.forEach((e) => y.mutate({
|
|
219
|
+
id: e.id,
|
|
220
|
+
input: { isAvailable: t }
|
|
221
|
+
}, { onError: () => W("Some offerings could not be updated on the server", "error") })), W(`${n.length} offerings ${e}d successfully`, "success");
|
|
222
|
+
}, Fe = () => {
|
|
223
|
+
if (b.length === 0) {
|
|
224
|
+
W("There are no offerings to export yet", "error");
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
let e = [[
|
|
228
|
+
"Name",
|
|
229
|
+
"Category",
|
|
230
|
+
"Price",
|
|
231
|
+
"Original Price",
|
|
232
|
+
"Stock",
|
|
233
|
+
"Available",
|
|
234
|
+
"Tags"
|
|
235
|
+
], ...b.map((e) => [
|
|
236
|
+
e.name,
|
|
237
|
+
e.category,
|
|
238
|
+
e.price,
|
|
239
|
+
e.originalPrice ?? "",
|
|
240
|
+
f(e.category) ? "" : e.stock,
|
|
241
|
+
e.isAvailable ? "Yes" : "No",
|
|
242
|
+
e.tags.join("; ")
|
|
243
|
+
])].map((e) => e.map(xe).join(",")).join("\n"), t = new Blob([e], { type: "text/csv;charset=utf-8;" }), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
244
|
+
r.href = n, r.download = `offerings-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n), W(`Exported ${b.length} offerings to CSV`, "success");
|
|
191
245
|
}, X = (e) => f(e.category) ? {
|
|
192
246
|
color: "text-status-success-text",
|
|
193
247
|
label: "Available"
|
|
@@ -200,7 +254,7 @@ var pe = [
|
|
|
200
254
|
} : {
|
|
201
255
|
color: "text-status-success-text",
|
|
202
256
|
label: `In Stock (${e.stock})`
|
|
203
|
-
}, Z =
|
|
257
|
+
}, Z = N.category ? f(N.category) : !1, Ie = N.category ? _e(N.category) : !1, Q = !Z && Ie, $ = N.name && N.description && N.category && N.price > 0 && (!Z || N.duration && N.duration > 0) && (Z || N.stock >= 0);
|
|
204
258
|
return /* @__PURE__ */ d(n, {
|
|
205
259
|
title: "Offerings Management",
|
|
206
260
|
description: "Manage your products and services",
|
|
@@ -211,21 +265,21 @@ var pe = [
|
|
|
211
265
|
children: [/* @__PURE__ */ u(l, { className: "h-4 w-4" }), "Add Item"]
|
|
212
266
|
}),
|
|
213
267
|
children: [
|
|
214
|
-
/* @__PURE__ */ u(
|
|
268
|
+
/* @__PURE__ */ u(he, {
|
|
215
269
|
className: "mb-6",
|
|
216
270
|
children: "The menu and stock control room for your cart. Use this page to add and edit the products and services you offer, set prices and availability, and keep stock levels accurate so customers never order something you can't fulfil. Watch the out-of-stock and low-stock counts and restock before they cost you sales."
|
|
217
271
|
}),
|
|
218
272
|
/* @__PURE__ */ d("div", {
|
|
219
273
|
className: "space-y-4",
|
|
220
274
|
children: [
|
|
221
|
-
|
|
222
|
-
className: t("flex items-center gap-2 rounded-lg border p-3",
|
|
223
|
-
children: [
|
|
224
|
-
className: t("text-sm font-medium",
|
|
225
|
-
children:
|
|
275
|
+
V && /* @__PURE__ */ d("div", {
|
|
276
|
+
className: t("flex items-center gap-2 rounded-lg border p-3", V.type === "success" ? "border-status-success-text/30 bg-status-success-bg-subtle" : "border-status-error-text/30 bg-status-error-bg-subtle"),
|
|
277
|
+
children: [V.type === "success" ? /* @__PURE__ */ u(oe, { className: "h-4 w-4 text-status-success-text" }) : /* @__PURE__ */ u(ae, { className: "h-4 w-4 text-status-error-text" }), /* @__PURE__ */ u("span", {
|
|
278
|
+
className: t("text-sm font-medium", V.type === "success" ? "text-status-success-text" : "text-status-error-text"),
|
|
279
|
+
children: V.text
|
|
226
280
|
})]
|
|
227
281
|
}),
|
|
228
|
-
/* @__PURE__ */ d(
|
|
282
|
+
/* @__PURE__ */ d(me, { children: [/* @__PURE__ */ u("h2", {
|
|
229
283
|
className: "mb-4 text-base font-semibold text-text-primary",
|
|
230
284
|
children: "Stock at a Glance"
|
|
231
285
|
}), /* @__PURE__ */ d("div", {
|
|
@@ -238,7 +292,7 @@ var pe = [
|
|
|
238
292
|
children: "Total Items"
|
|
239
293
|
}), /* @__PURE__ */ u("p", {
|
|
240
294
|
className: "text-2xl font-bold text-text-primary",
|
|
241
|
-
children:
|
|
295
|
+
children: Ae
|
|
242
296
|
})]
|
|
243
297
|
}),
|
|
244
298
|
/* @__PURE__ */ d("div", {
|
|
@@ -248,7 +302,7 @@ var pe = [
|
|
|
248
302
|
children: "Available"
|
|
249
303
|
}), /* @__PURE__ */ u("p", {
|
|
250
304
|
className: "text-2xl font-bold text-status-success-text",
|
|
251
|
-
children:
|
|
305
|
+
children: je
|
|
252
306
|
})]
|
|
253
307
|
}),
|
|
254
308
|
/* @__PURE__ */ d("div", {
|
|
@@ -258,7 +312,7 @@ var pe = [
|
|
|
258
312
|
children: "Out of Stock"
|
|
259
313
|
}), /* @__PURE__ */ u("p", {
|
|
260
314
|
className: "text-2xl font-bold text-status-error-text",
|
|
261
|
-
children:
|
|
315
|
+
children: Me
|
|
262
316
|
})]
|
|
263
317
|
}),
|
|
264
318
|
/* @__PURE__ */ d("div", {
|
|
@@ -268,7 +322,7 @@ var pe = [
|
|
|
268
322
|
children: "Low Stock"
|
|
269
323
|
}), /* @__PURE__ */ u("p", {
|
|
270
324
|
className: "text-2xl font-bold text-status-warning-text",
|
|
271
|
-
children:
|
|
325
|
+
children: Ne
|
|
272
326
|
})]
|
|
273
327
|
})
|
|
274
328
|
]
|
|
@@ -299,40 +353,49 @@ var pe = [
|
|
|
299
353
|
children: "Disable All"
|
|
300
354
|
})
|
|
301
355
|
]
|
|
302
|
-
}), /* @__PURE__ */ d("
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
356
|
+
}), /* @__PURE__ */ d("div", {
|
|
357
|
+
className: "flex flex-wrap gap-2",
|
|
358
|
+
children: [/* @__PURE__ */ d("button", {
|
|
359
|
+
type: "button",
|
|
360
|
+
onClick: Fe,
|
|
361
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken transition-colors",
|
|
362
|
+
children: [/* @__PURE__ */ u(se, { className: "h-4 w-4" }), "Export CSV"]
|
|
363
|
+
}), /* @__PURE__ */ d("button", {
|
|
364
|
+
type: "button",
|
|
365
|
+
disabled: !0,
|
|
366
|
+
title: "Bulk import is coming soon",
|
|
367
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary opacity-60 cursor-not-allowed",
|
|
368
|
+
children: [/* @__PURE__ */ u(de, { className: "h-4 w-4" }), "Import (coming soon)"]
|
|
369
|
+
})]
|
|
307
370
|
})]
|
|
308
371
|
}), /* @__PURE__ */ d("div", {
|
|
309
372
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",
|
|
310
373
|
children: [
|
|
311
374
|
/* @__PURE__ */ d("div", {
|
|
312
375
|
className: "relative sm:col-span-2 lg:col-span-1",
|
|
313
|
-
children: [/* @__PURE__ */ u(
|
|
376
|
+
children: [/* @__PURE__ */ u(le, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ u("input", {
|
|
314
377
|
type: "text",
|
|
315
378
|
placeholder: "Search offerings...",
|
|
316
|
-
value:
|
|
317
|
-
onChange: (e) =>
|
|
379
|
+
value: S,
|
|
380
|
+
onChange: (e) => C(e.target.value),
|
|
318
381
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface pl-10 pr-4 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
319
382
|
})]
|
|
320
383
|
}),
|
|
321
384
|
/* @__PURE__ */ d("select", {
|
|
322
|
-
value:
|
|
323
|
-
onChange: (e) =>
|
|
385
|
+
value: w,
|
|
386
|
+
onChange: (e) => T(e.target.value),
|
|
324
387
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
325
388
|
children: [/* @__PURE__ */ u("option", {
|
|
326
389
|
value: "",
|
|
327
390
|
children: "All Categories"
|
|
328
|
-
}),
|
|
391
|
+
}), ke.map((e) => /* @__PURE__ */ u("option", {
|
|
329
392
|
value: e,
|
|
330
393
|
children: e
|
|
331
394
|
}, e))]
|
|
332
395
|
}),
|
|
333
396
|
/* @__PURE__ */ d("select", {
|
|
334
|
-
value:
|
|
335
|
-
onChange: (e) =>
|
|
397
|
+
value: E,
|
|
398
|
+
onChange: (e) => D(e.target.value),
|
|
336
399
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
337
400
|
children: [
|
|
338
401
|
/* @__PURE__ */ u("option", {
|
|
@@ -350,8 +413,8 @@ var pe = [
|
|
|
350
413
|
]
|
|
351
414
|
}),
|
|
352
415
|
/* @__PURE__ */ d("select", {
|
|
353
|
-
value:
|
|
354
|
-
onChange: (e) =>
|
|
416
|
+
value: O,
|
|
417
|
+
onChange: (e) => k(e.target.value),
|
|
355
418
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
356
419
|
children: [
|
|
357
420
|
/* @__PURE__ */ u("option", {
|
|
@@ -375,13 +438,13 @@ var pe = [
|
|
|
375
438
|
]
|
|
376
439
|
})]
|
|
377
440
|
}),
|
|
378
|
-
|
|
441
|
+
Ce ? /* @__PURE__ */ u("div", {
|
|
379
442
|
className: "flex items-center justify-center py-16",
|
|
380
443
|
children: /* @__PURE__ */ u("div", { className: "h-10 w-10 animate-spin rounded-full border-b-2 border-foreground" })
|
|
381
444
|
}) : U.length === 0 ? /* @__PURE__ */ u(r, {
|
|
382
|
-
illustration:
|
|
445
|
+
illustration: S || w || E ? "empty-search" : "empty-files",
|
|
383
446
|
title: "No items found",
|
|
384
|
-
description:
|
|
447
|
+
description: S || w || E ? "No items match your current filters. Try adjusting your search criteria." : "You haven't added any items yet. Start building your offerings so customers can order from you.",
|
|
385
448
|
action: /* @__PURE__ */ d("div", {
|
|
386
449
|
className: "flex flex-wrap justify-center gap-3",
|
|
387
450
|
children: [/* @__PURE__ */ d("button", {
|
|
@@ -389,16 +452,16 @@ var pe = [
|
|
|
389
452
|
onClick: G,
|
|
390
453
|
className: "inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent/80",
|
|
391
454
|
children: [/* @__PURE__ */ u(l, { className: "h-4 w-4" }), "Add Your First Item"]
|
|
392
|
-
}), (
|
|
455
|
+
}), (S || w || E) && /* @__PURE__ */ u("button", {
|
|
393
456
|
type: "button",
|
|
394
457
|
onClick: () => {
|
|
395
|
-
|
|
458
|
+
C(""), T(""), D(""), k("name");
|
|
396
459
|
},
|
|
397
460
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm text-text-primary hover:bg-bg-sunken",
|
|
398
461
|
children: "Clear Filters"
|
|
399
462
|
})]
|
|
400
463
|
})
|
|
401
|
-
}) : /* @__PURE__ */ d(
|
|
464
|
+
}) : /* @__PURE__ */ d(pe, { children: [/* @__PURE__ */ u("div", {
|
|
402
465
|
className: "hidden lg:block rounded-lg border border-border-subtle bg-bg-surface shadow-sm overflow-hidden",
|
|
403
466
|
children: /* @__PURE__ */ u("div", {
|
|
404
467
|
className: "overflow-x-auto",
|
|
@@ -495,13 +558,13 @@ var pe = [
|
|
|
495
558
|
onClick: () => K(e),
|
|
496
559
|
className: "rounded p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary transition-colors",
|
|
497
560
|
title: "Edit",
|
|
498
|
-
children: /* @__PURE__ */ u(
|
|
561
|
+
children: /* @__PURE__ */ u(ce, { className: "h-4 w-4" })
|
|
499
562
|
}), /* @__PURE__ */ u("button", {
|
|
500
563
|
type: "button",
|
|
501
564
|
onClick: () => q(e.id),
|
|
502
565
|
className: "rounded p-1.5 text-text-secondary hover:bg-status-error-bg-subtle hover:text-status-error-text transition-colors",
|
|
503
566
|
title: "Delete",
|
|
504
|
-
children: /* @__PURE__ */ u(
|
|
567
|
+
children: /* @__PURE__ */ u(ue, { className: "h-4 w-4" })
|
|
505
568
|
})]
|
|
506
569
|
})
|
|
507
570
|
})
|
|
@@ -586,7 +649,7 @@ var pe = [
|
|
|
586
649
|
})] })
|
|
587
650
|
]
|
|
588
651
|
}),
|
|
589
|
-
|
|
652
|
+
Oe && /* @__PURE__ */ u("div", {
|
|
590
653
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
|
|
591
654
|
children: /* @__PURE__ */ u("div", {
|
|
592
655
|
className: "w-full max-w-2xl max-h-[90vh] overflow-y-auto rounded-lg border border-border-subtle bg-bg-surface shadow-xl",
|
|
@@ -597,20 +660,20 @@ var pe = [
|
|
|
597
660
|
className: "flex items-center justify-between mb-4",
|
|
598
661
|
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h3", {
|
|
599
662
|
className: "text-lg font-semibold text-text-primary",
|
|
600
|
-
children:
|
|
601
|
-
}),
|
|
663
|
+
children: j ? "Edit Item" : "Add New Item"
|
|
664
|
+
}), N.category && /* @__PURE__ */ d("p", {
|
|
602
665
|
className: "text-sm text-text-secondary mt-0.5",
|
|
603
666
|
children: [
|
|
604
667
|
"Type: ",
|
|
605
668
|
Z ? "Service" : "Product",
|
|
606
669
|
" | Category: ",
|
|
607
|
-
|
|
670
|
+
N.category
|
|
608
671
|
]
|
|
609
672
|
})] }), /* @__PURE__ */ u("button", {
|
|
610
673
|
type: "button",
|
|
611
|
-
onClick: () =>
|
|
674
|
+
onClick: () => A(!1),
|
|
612
675
|
className: "rounded p-1.5 text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors",
|
|
613
|
-
children: /* @__PURE__ */ u(
|
|
676
|
+
children: /* @__PURE__ */ u(fe, { className: "h-5 w-5" })
|
|
614
677
|
})]
|
|
615
678
|
}),
|
|
616
679
|
/* @__PURE__ */ d("div", {
|
|
@@ -623,8 +686,8 @@ var pe = [
|
|
|
623
686
|
children: "Item Name *"
|
|
624
687
|
}), /* @__PURE__ */ u("input", {
|
|
625
688
|
type: "text",
|
|
626
|
-
value:
|
|
627
|
-
onChange: (e) =>
|
|
689
|
+
value: N.name,
|
|
690
|
+
onChange: (e) => P((t) => ({
|
|
628
691
|
...t,
|
|
629
692
|
name: e.target.value
|
|
630
693
|
})),
|
|
@@ -634,8 +697,8 @@ var pe = [
|
|
|
634
697
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
635
698
|
children: "Category *"
|
|
636
699
|
}), /* @__PURE__ */ d("select", {
|
|
637
|
-
value:
|
|
638
|
-
onChange: (e) =>
|
|
700
|
+
value: N.category,
|
|
701
|
+
onChange: (e) => P((t) => ({
|
|
639
702
|
...t,
|
|
640
703
|
category: e.target.value
|
|
641
704
|
})),
|
|
@@ -643,7 +706,7 @@ var pe = [
|
|
|
643
706
|
children: [/* @__PURE__ */ u("option", {
|
|
644
707
|
value: "",
|
|
645
708
|
children: "Select category"
|
|
646
|
-
}),
|
|
709
|
+
}), ye.map((e) => /* @__PURE__ */ u("option", {
|
|
647
710
|
value: e,
|
|
648
711
|
children: e
|
|
649
712
|
}, e))]
|
|
@@ -653,8 +716,8 @@ var pe = [
|
|
|
653
716
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
654
717
|
children: "Description *"
|
|
655
718
|
}), /* @__PURE__ */ u("textarea", {
|
|
656
|
-
value:
|
|
657
|
-
onChange: (e) =>
|
|
719
|
+
value: N.description,
|
|
720
|
+
onChange: (e) => P((t) => ({
|
|
658
721
|
...t,
|
|
659
722
|
description: e.target.value
|
|
660
723
|
})),
|
|
@@ -669,8 +732,8 @@ var pe = [
|
|
|
669
732
|
children: "Price *"
|
|
670
733
|
}), /* @__PURE__ */ u("input", {
|
|
671
734
|
type: "number",
|
|
672
|
-
value:
|
|
673
|
-
onChange: (e) =>
|
|
735
|
+
value: N.price,
|
|
736
|
+
onChange: (e) => P((t) => ({
|
|
674
737
|
...t,
|
|
675
738
|
price: parseInt(e.target.value) || 0
|
|
676
739
|
})),
|
|
@@ -680,8 +743,8 @@ var pe = [
|
|
|
680
743
|
children: "Original Price"
|
|
681
744
|
}), /* @__PURE__ */ u("input", {
|
|
682
745
|
type: "number",
|
|
683
|
-
value:
|
|
684
|
-
onChange: (e) =>
|
|
746
|
+
value: N.originalPrice ?? "",
|
|
747
|
+
onChange: (e) => P((t) => ({
|
|
685
748
|
...t,
|
|
686
749
|
originalPrice: e.target.value ? parseInt(e.target.value) : void 0
|
|
687
750
|
})),
|
|
@@ -697,8 +760,8 @@ var pe = [
|
|
|
697
760
|
children: "Stock Quantity *"
|
|
698
761
|
}), /* @__PURE__ */ u("input", {
|
|
699
762
|
type: "number",
|
|
700
|
-
value:
|
|
701
|
-
onChange: (e) =>
|
|
763
|
+
value: N.stock,
|
|
764
|
+
onChange: (e) => P((t) => ({
|
|
702
765
|
...t,
|
|
703
766
|
stock: parseInt(e.target.value) || 0
|
|
704
767
|
})),
|
|
@@ -709,8 +772,8 @@ var pe = [
|
|
|
709
772
|
children: "Preparation Time (min)"
|
|
710
773
|
}), /* @__PURE__ */ u("input", {
|
|
711
774
|
type: "number",
|
|
712
|
-
value:
|
|
713
|
-
onChange: (e) =>
|
|
775
|
+
value: N.preparationTime,
|
|
776
|
+
onChange: (e) => P((t) => ({
|
|
714
777
|
...t,
|
|
715
778
|
preparationTime: parseInt(e.target.value) || 0
|
|
716
779
|
})),
|
|
@@ -721,8 +784,8 @@ var pe = [
|
|
|
721
784
|
children: "Calories"
|
|
722
785
|
}), /* @__PURE__ */ u("input", {
|
|
723
786
|
type: "number",
|
|
724
|
-
value:
|
|
725
|
-
onChange: (e) =>
|
|
787
|
+
value: N.calories,
|
|
788
|
+
onChange: (e) => P((t) => ({
|
|
726
789
|
...t,
|
|
727
790
|
calories: parseInt(e.target.value) || 0
|
|
728
791
|
})),
|
|
@@ -737,8 +800,8 @@ var pe = [
|
|
|
737
800
|
children: "Service Duration (min) *"
|
|
738
801
|
}), /* @__PURE__ */ u("input", {
|
|
739
802
|
type: "number",
|
|
740
|
-
value:
|
|
741
|
-
onChange: (e) =>
|
|
803
|
+
value: N.duration,
|
|
804
|
+
onChange: (e) => P((t) => ({
|
|
742
805
|
...t,
|
|
743
806
|
duration: parseInt(e.target.value) || 30
|
|
744
807
|
})),
|
|
@@ -748,8 +811,8 @@ var pe = [
|
|
|
748
811
|
children: "Setup Time (min)"
|
|
749
812
|
}), /* @__PURE__ */ u("input", {
|
|
750
813
|
type: "number",
|
|
751
|
-
value:
|
|
752
|
-
onChange: (e) =>
|
|
814
|
+
value: N.preparationTime,
|
|
815
|
+
onChange: (e) => P((t) => ({
|
|
753
816
|
...t,
|
|
754
817
|
preparationTime: parseInt(e.target.value) || 0
|
|
755
818
|
})),
|
|
@@ -762,8 +825,8 @@ var pe = [
|
|
|
762
825
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
763
826
|
children: "Spice Level"
|
|
764
827
|
}), /* @__PURE__ */ d("select", {
|
|
765
|
-
value:
|
|
766
|
-
onChange: (e) =>
|
|
828
|
+
value: N.spiceLevel,
|
|
829
|
+
onChange: (e) => P((t) => ({
|
|
767
830
|
...t,
|
|
768
831
|
spiceLevel: e.target.value
|
|
769
832
|
})),
|
|
@@ -803,8 +866,8 @@ var pe = [
|
|
|
803
866
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
804
867
|
children: [/* @__PURE__ */ u("input", {
|
|
805
868
|
type: "checkbox",
|
|
806
|
-
checked:
|
|
807
|
-
onChange: (t) =>
|
|
869
|
+
checked: N[e],
|
|
870
|
+
onChange: (t) => P((n) => ({
|
|
808
871
|
...n,
|
|
809
872
|
[e]: t.target.checked
|
|
810
873
|
})),
|
|
@@ -817,8 +880,8 @@ var pe = [
|
|
|
817
880
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
818
881
|
children: "Service Type *"
|
|
819
882
|
}), /* @__PURE__ */ d("select", {
|
|
820
|
-
value:
|
|
821
|
-
onChange: (e) =>
|
|
883
|
+
value: N.serviceType,
|
|
884
|
+
onChange: (e) => P((t) => ({
|
|
822
885
|
...t,
|
|
823
886
|
serviceType: e.target.value
|
|
824
887
|
})),
|
|
@@ -849,15 +912,15 @@ var pe = [
|
|
|
849
912
|
}),
|
|
850
913
|
/* @__PURE__ */ u("input", {
|
|
851
914
|
type: "text",
|
|
852
|
-
value:
|
|
853
|
-
onChange: (e) =>
|
|
915
|
+
value: F,
|
|
916
|
+
onChange: (e) => I(e.target.value),
|
|
854
917
|
placeholder: Z ? "professional, certified, quick" : "popular, spicy, traditional",
|
|
855
918
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary"
|
|
856
919
|
}),
|
|
857
920
|
/* @__PURE__ */ d("p", {
|
|
858
921
|
className: "text-xs text-text-secondary mt-1",
|
|
859
922
|
children: [
|
|
860
|
-
|
|
923
|
+
F.split(",").map((e) => e.trim()).filter(Boolean).length,
|
|
861
924
|
" ",
|
|
862
925
|
"tags"
|
|
863
926
|
]
|
|
@@ -868,8 +931,8 @@ var pe = [
|
|
|
868
931
|
children: "Allergens (comma separated)"
|
|
869
932
|
}), /* @__PURE__ */ u("input", {
|
|
870
933
|
type: "text",
|
|
871
|
-
value:
|
|
872
|
-
onChange: (e) =>
|
|
934
|
+
value: L,
|
|
935
|
+
onChange: (e) => R(e.target.value),
|
|
873
936
|
placeholder: "nuts, dairy, gluten, soy",
|
|
874
937
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary"
|
|
875
938
|
})] }),
|
|
@@ -878,8 +941,8 @@ var pe = [
|
|
|
878
941
|
children: "Service Requirements (comma separated)"
|
|
879
942
|
}), /* @__PURE__ */ u("input", {
|
|
880
943
|
type: "text",
|
|
881
|
-
value:
|
|
882
|
-
onChange: (e) =>
|
|
944
|
+
value: z,
|
|
945
|
+
onChange: (e) => B(e.target.value),
|
|
883
946
|
placeholder: "advance booking, payment required, tools provided",
|
|
884
947
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary"
|
|
885
948
|
})] })
|
|
@@ -889,15 +952,15 @@ var pe = [
|
|
|
889
952
|
className: "flex gap-3 mt-6",
|
|
890
953
|
children: [/* @__PURE__ */ u("button", {
|
|
891
954
|
type: "button",
|
|
892
|
-
onClick: () =>
|
|
955
|
+
onClick: () => A(!1),
|
|
893
956
|
className: "flex-1 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
894
957
|
children: "Cancel"
|
|
895
958
|
}), /* @__PURE__ */ u("button", {
|
|
896
959
|
type: "button",
|
|
897
|
-
onClick:
|
|
960
|
+
onClick: Pe,
|
|
898
961
|
disabled: !$,
|
|
899
962
|
className: t("flex-1 rounded-md px-4 py-2 text-sm font-medium transition-colors", $ ? "bg-accent text-text-primary hover:bg-accent/80" : "bg-bg-sunken text-text-secondary cursor-not-allowed"),
|
|
900
|
-
children:
|
|
963
|
+
children: j ? "Update Item" : "Add Item"
|
|
901
964
|
})]
|
|
902
965
|
})
|
|
903
966
|
]
|