@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.
- package/README.md +12 -0
- package/dist/adaptercloud/AdapterCloudRoot.js +177 -0
- package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -0
- package/dist/adaptercloud/AdapterCloudRoutes.js +215 -0
- package/dist/adaptercloud/AdapterCloudRoutes.js.map +1 -0
- package/dist/adaptercloud/components/EmptyState.js +28 -0
- package/dist/adaptercloud/components/EmptyState.js.map +1 -0
- package/dist/adaptercloud/components/InvestmentCard.js +96 -0
- package/dist/adaptercloud/components/InvestmentCard.js.map +1 -0
- package/dist/adaptercloud/components/MetricsCard.js +46 -0
- package/dist/adaptercloud/components/MetricsCard.js.map +1 -0
- package/dist/adaptercloud/components/PageLayout.js +26 -0
- package/dist/adaptercloud/components/PageLayout.js.map +1 -0
- package/dist/adaptercloud/components/RatingDisplay.js +35 -0
- package/dist/adaptercloud/components/RatingDisplay.js.map +1 -0
- package/dist/adaptercloud/components/StatusBadge.js +45 -0
- package/dist/adaptercloud/components/StatusBadge.js.map +1 -0
- package/dist/adaptercloud/context/AdapterCloudContext.js +93 -0
- package/dist/adaptercloud/context/AdapterCloudContext.js.map +1 -0
- package/dist/adaptercloud/context/index.js +1 -0
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js +223 -0
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -0
- package/dist/adaptercloud/index.js +7 -0
- package/dist/adaptercloud/mocks/data.js +1517 -0
- package/dist/adaptercloud/mocks/data.js.map +1 -0
- package/dist/adaptercloud/mocks/users.js +34 -0
- package/dist/adaptercloud/mocks/users.js.map +1 -0
- package/dist/adaptercloud/pages/HomePage.js +921 -0
- package/dist/adaptercloud/pages/HomePage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +645 -0
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/AdminDashboard.js +639 -0
- package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +1 -0
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +421 -0
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +660 -0
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js +259 -0
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +649 -0
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/CartManagementPage.js +869 -0
- package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +1 -0
- package/dist/adaptercloud/pages/admin/UserManagementPage.js +893 -0
- package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +834 -0
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +700 -0
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +760 -0
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +886 -0
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +631 -0
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +913 -0
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +881 -0
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +1 -0
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +833 -0
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +1 -0
- package/dist/adaptercloud/pages/common/HelpSupportPage.js +1325 -0
- package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +1 -0
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js +665 -0
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +1 -0
- package/dist/adaptercloud/pages/common/SettingsPage.js +964 -0
- package/dist/adaptercloud/pages/common/SettingsPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +593 -0
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/CartDetailPage.js +620 -0
- package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +547 -0
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/CheckoutPage.js +532 -0
- package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js +496 -0
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +1 -0
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +621 -0
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +623 -0
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/FavoritesPage.js +477 -0
- package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +438 -0
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +388 -0
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +488 -0
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/ReviewsPage.js +606 -0
- package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +1 -0
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +443 -0
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +849 -0
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +939 -0
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +681 -0
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js +419 -0
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +399 -0
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +569 -0
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +1 -0
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +1065 -0
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +1 -0
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +496 -0
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +1 -0
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js +634 -0
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +1 -0
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +675 -0
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +1 -0
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +687 -0
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +1 -0
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +578 -0
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +1 -0
- package/dist/adaptercloud/store/adaptercloudStore.js +38 -0
- package/dist/adaptercloud/store/adaptercloudStore.js.map +1 -0
- package/dist/adaptercloud/store/index.js +1 -0
- package/dist/adaptercloud/utils/cn.js +10 -0
- package/dist/adaptercloud/utils/cn.js.map +1 -0
- package/dist/adaptercloud/utils/formatters.js +51 -0
- package/dist/adaptercloud/utils/formatters.js.map +1 -0
- package/dist/adaptercloud/utils/navigation.js +9 -0
- package/dist/adaptercloud/utils/navigation.js.map +1 -0
- package/dist/index.js +7 -0
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
- package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/package.json +106 -0
|
@@ -0,0 +1,913 @@
|
|
|
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 { formatCurrency as r } from "../../utils/formatters.js";
|
|
5
|
+
import { mockProducts as i } from "../../mocks/data.js";
|
|
6
|
+
import { useMemo as a, useState as o } from "react";
|
|
7
|
+
import { AlertCircle as ee, CheckCircle2 as te, Edit2 as ne, Package as s, Plus as c, Search as re, Trash2 as ie, Upload as ae, X as oe } from "lucide-react";
|
|
8
|
+
import { Fragment as se, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
//#region src/adaptercloud/pages/cart-owner/InventoryManagementPage.tsx
|
|
10
|
+
var d = [
|
|
11
|
+
"Service",
|
|
12
|
+
"Repair",
|
|
13
|
+
"Beauty",
|
|
14
|
+
"Care",
|
|
15
|
+
"Cleaning",
|
|
16
|
+
"Health",
|
|
17
|
+
"Wellness",
|
|
18
|
+
"Education"
|
|
19
|
+
], f = (e) => d.some((t) => e.includes(t)), p = (e) => e === "Food & Beverage", m = [
|
|
20
|
+
10,
|
|
21
|
+
25,
|
|
22
|
+
0,
|
|
23
|
+
50,
|
|
24
|
+
8,
|
|
25
|
+
15,
|
|
26
|
+
3,
|
|
27
|
+
100,
|
|
28
|
+
42,
|
|
29
|
+
0,
|
|
30
|
+
20,
|
|
31
|
+
6,
|
|
32
|
+
35,
|
|
33
|
+
18,
|
|
34
|
+
12,
|
|
35
|
+
30,
|
|
36
|
+
5,
|
|
37
|
+
22,
|
|
38
|
+
0,
|
|
39
|
+
45
|
|
40
|
+
], h = () => i.slice(0, 20).map((e, t) => ({
|
|
41
|
+
id: e.id,
|
|
42
|
+
name: e.name,
|
|
43
|
+
description: e.description ?? `${e.name} - quality offering from ${e.cartName}`,
|
|
44
|
+
price: e.price,
|
|
45
|
+
originalPrice: t % 4 == 0 ? Math.round(e.price * 1.2) : void 0,
|
|
46
|
+
category: e.category,
|
|
47
|
+
stock: m[t] ?? 10,
|
|
48
|
+
isAvailable: t !== 2 && t !== 9 && t !== 18,
|
|
49
|
+
cartName: e.cartName,
|
|
50
|
+
preparationTime: 15,
|
|
51
|
+
calories: p(e.category) ? Math.floor(Math.random() * 400) + 100 : 0,
|
|
52
|
+
isVegetarian: t % 3 == 0,
|
|
53
|
+
isVegan: t % 5 == 0,
|
|
54
|
+
isGlutenFree: t % 7 == 0,
|
|
55
|
+
spiceLevel: [
|
|
56
|
+
"mild",
|
|
57
|
+
"medium",
|
|
58
|
+
"spicy",
|
|
59
|
+
"none"
|
|
60
|
+
][t % 4],
|
|
61
|
+
tags: [
|
|
62
|
+
"popular",
|
|
63
|
+
"trending",
|
|
64
|
+
"new"
|
|
65
|
+
].slice(0, t % 3 + 1),
|
|
66
|
+
allergens: p(e.category) ? ["nuts", "dairy"].slice(0, t % 2 + 1) : [],
|
|
67
|
+
duration: f(e.category) ? 30 + t * 5 : 0,
|
|
68
|
+
serviceType: f(e.category) ? [
|
|
69
|
+
"instant",
|
|
70
|
+
"appointment",
|
|
71
|
+
"recurring",
|
|
72
|
+
"consultation"
|
|
73
|
+
][t % 4] : "",
|
|
74
|
+
requirements: f(e.category) ? ["advance booking"] : []
|
|
75
|
+
})), g = {
|
|
76
|
+
name: "",
|
|
77
|
+
description: "",
|
|
78
|
+
category: "",
|
|
79
|
+
price: 0,
|
|
80
|
+
originalPrice: void 0,
|
|
81
|
+
isAvailable: !0,
|
|
82
|
+
stock: 0,
|
|
83
|
+
preparationTime: 15,
|
|
84
|
+
calories: 0,
|
|
85
|
+
isVegetarian: !1,
|
|
86
|
+
isVegan: !1,
|
|
87
|
+
isGlutenFree: !1,
|
|
88
|
+
spiceLevel: "mild",
|
|
89
|
+
tags: [],
|
|
90
|
+
allergens: [],
|
|
91
|
+
duration: 30,
|
|
92
|
+
serviceType: "instant",
|
|
93
|
+
requirements: []
|
|
94
|
+
}, _ = () => {
|
|
95
|
+
let { navigateTo: i } = e(), [d, m] = o(h), [_, v] = o(""), [y, b] = o(""), [x, S] = o(""), [C, w] = o("name"), [ce, le] = o(!1), [ue, T] = o(!1), [E, D] = o(null), [O, k] = o(g), [A, j] = o(""), [M, N] = o(""), [P, F] = o(""), [I, L] = o(null), R = a(() => [...new Set(d.map((e) => e.category))].sort(), [d]), z = a(() => {
|
|
96
|
+
let e = [...d];
|
|
97
|
+
if (_) {
|
|
98
|
+
let t = _.toLowerCase();
|
|
99
|
+
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)));
|
|
100
|
+
}
|
|
101
|
+
switch (y && (e = e.filter((e) => e.category === y)), x === "available" ? e = e.filter((e) => e.isAvailable) : x === "unavailable" && (e = e.filter((e) => !e.isAvailable)), C) {
|
|
102
|
+
case "name":
|
|
103
|
+
e.sort((e, t) => e.name.localeCompare(t.name));
|
|
104
|
+
break;
|
|
105
|
+
case "price_low":
|
|
106
|
+
e.sort((e, t) => e.price - t.price);
|
|
107
|
+
break;
|
|
108
|
+
case "price_high":
|
|
109
|
+
e.sort((e, t) => t.price - e.price);
|
|
110
|
+
break;
|
|
111
|
+
case "stock":
|
|
112
|
+
e.sort((e, t) => e.stock - t.stock);
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
return e;
|
|
116
|
+
}, [
|
|
117
|
+
d,
|
|
118
|
+
_,
|
|
119
|
+
y,
|
|
120
|
+
x,
|
|
121
|
+
C
|
|
122
|
+
]), B = d.length, V = d.filter((e) => e.isAvailable).length, H = d.filter((e) => !f(e.category) && e.stock === 0).length, U = d.filter((e) => !f(e.category) && e.stock > 0 && e.stock < 10).length, W = (e, t) => {
|
|
123
|
+
L({
|
|
124
|
+
text: e,
|
|
125
|
+
type: t
|
|
126
|
+
}), setTimeout(() => L(null), 3e3);
|
|
127
|
+
}, G = () => {
|
|
128
|
+
D(null), k({
|
|
129
|
+
...g,
|
|
130
|
+
category: R[0] || ""
|
|
131
|
+
}), j(""), N(""), F(""), T(!0);
|
|
132
|
+
}, K = (e) => {
|
|
133
|
+
D(e), k({
|
|
134
|
+
name: e.name,
|
|
135
|
+
description: e.description,
|
|
136
|
+
category: e.category,
|
|
137
|
+
price: e.price,
|
|
138
|
+
originalPrice: e.originalPrice,
|
|
139
|
+
isAvailable: e.isAvailable,
|
|
140
|
+
stock: e.stock,
|
|
141
|
+
preparationTime: e.preparationTime,
|
|
142
|
+
calories: e.calories,
|
|
143
|
+
isVegetarian: e.isVegetarian,
|
|
144
|
+
isVegan: e.isVegan,
|
|
145
|
+
isGlutenFree: e.isGlutenFree,
|
|
146
|
+
spiceLevel: e.spiceLevel,
|
|
147
|
+
tags: e.tags,
|
|
148
|
+
allergens: e.allergens,
|
|
149
|
+
duration: e.duration,
|
|
150
|
+
serviceType: e.serviceType,
|
|
151
|
+
requirements: e.requirements
|
|
152
|
+
}), j(e.tags.join(", ")), N(e.allergens.join(", ")), F(e.requirements.join(", ")), T(!0);
|
|
153
|
+
}, de = () => {
|
|
154
|
+
if (!O.name || !O.description || !O.category || O.price <= 0) {
|
|
155
|
+
W("Please fill all required fields (name, description, category, price > 0)", "error");
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
let e = A.split(",").map((e) => e.trim()).filter(Boolean), t = M.split(",").map((e) => e.trim()).filter(Boolean), n = P.split(",").map((e) => e.trim()).filter(Boolean), r = f(O.category) ? "Service" : "Product";
|
|
159
|
+
if (E) m((r) => r.map((r) => r.id === E.id ? {
|
|
160
|
+
...r,
|
|
161
|
+
...O,
|
|
162
|
+
tags: e,
|
|
163
|
+
allergens: t,
|
|
164
|
+
requirements: n
|
|
165
|
+
} : r)), W(`${r} updated successfully`, "success");
|
|
166
|
+
else {
|
|
167
|
+
let i = {
|
|
168
|
+
id: `item-${Date.now()}`,
|
|
169
|
+
...O,
|
|
170
|
+
tags: e,
|
|
171
|
+
allergens: t,
|
|
172
|
+
requirements: n,
|
|
173
|
+
cartName: "Dosa Express"
|
|
174
|
+
};
|
|
175
|
+
m((e) => [i, ...e]), W(`${r} added successfully`, "success");
|
|
176
|
+
}
|
|
177
|
+
T(!1);
|
|
178
|
+
}, q = (e) => {
|
|
179
|
+
confirm("Are you sure you want to delete this offering?") && (m((t) => t.filter((t) => t.id !== e)), W("Offering deleted successfully", "success"));
|
|
180
|
+
}, J = (e, t) => {
|
|
181
|
+
m((n) => n.map((n) => n.id === e ? {
|
|
182
|
+
...n,
|
|
183
|
+
isAvailable: t
|
|
184
|
+
} : n)), W(`Offering ${t ? "enabled" : "disabled"} successfully`, "success");
|
|
185
|
+
}, Y = (e) => {
|
|
186
|
+
let t = e === "enable", n = d.filter((e) => e.isAvailable !== t).length;
|
|
187
|
+
if (n === 0) {
|
|
188
|
+
W(`No offerings to ${e}`, "error");
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
m((e) => e.map((e) => ({
|
|
192
|
+
...e,
|
|
193
|
+
isAvailable: t
|
|
194
|
+
}))), W(`${n} offerings ${e}d successfully`, "success");
|
|
195
|
+
}, X = (e) => f(e.category) ? {
|
|
196
|
+
color: "text-green-600 dark:text-green-400",
|
|
197
|
+
label: "Available"
|
|
198
|
+
} : e.stock === 0 ? {
|
|
199
|
+
color: "text-red-600 dark:text-red-400",
|
|
200
|
+
label: "Out of Stock"
|
|
201
|
+
} : e.stock < 10 ? {
|
|
202
|
+
color: "text-yellow-600 dark:text-yellow-400",
|
|
203
|
+
label: `Low Stock (${e.stock})`
|
|
204
|
+
} : {
|
|
205
|
+
color: "text-green-600 dark:text-green-400",
|
|
206
|
+
label: `In Stock (${e.stock})`
|
|
207
|
+
}, Z = O.category ? f(O.category) : !1, fe = O.category ? p(O.category) : !1, Q = !Z && fe, $ = O.name && O.description && O.category && O.price > 0 && (!Z || O.duration && O.duration > 0) && (Z || O.stock >= 0);
|
|
208
|
+
return /* @__PURE__ */ u(n, {
|
|
209
|
+
title: "Offerings Management",
|
|
210
|
+
description: "Manage your products and services",
|
|
211
|
+
actions: /* @__PURE__ */ u("button", {
|
|
212
|
+
type: "button",
|
|
213
|
+
onClick: G,
|
|
214
|
+
className: "inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-foreground hover:bg-accent/80 transition-colors",
|
|
215
|
+
children: [/* @__PURE__ */ l(c, { className: "h-4 w-4" }), "Add Item"]
|
|
216
|
+
}),
|
|
217
|
+
children: [/* @__PURE__ */ u("div", {
|
|
218
|
+
className: "space-y-4",
|
|
219
|
+
children: [
|
|
220
|
+
I && /* @__PURE__ */ u("div", {
|
|
221
|
+
className: t("flex items-center gap-2 rounded-lg border p-3", I.type === "success" ? "border-green-500/30 bg-green-500/10" : "border-red-500/30 bg-red-500/10"),
|
|
222
|
+
children: [I.type === "success" ? /* @__PURE__ */ l(te, { className: "h-4 w-4 text-green-600 dark:text-green-400" }) : /* @__PURE__ */ l(ee, { className: "h-4 w-4 text-red-600 dark:text-red-400" }), /* @__PURE__ */ l("span", {
|
|
223
|
+
className: t("text-sm font-medium", I.type === "success" ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400"),
|
|
224
|
+
children: I.text
|
|
225
|
+
})]
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ u("div", {
|
|
228
|
+
className: "grid grid-cols-2 lg:grid-cols-4 gap-3",
|
|
229
|
+
children: [
|
|
230
|
+
/* @__PURE__ */ u("div", {
|
|
231
|
+
className: "rounded-lg border border-border bg-card p-4 shadow-sm",
|
|
232
|
+
children: [/* @__PURE__ */ l("p", {
|
|
233
|
+
className: "text-xs text-muted-foreground",
|
|
234
|
+
children: "Total Items"
|
|
235
|
+
}), /* @__PURE__ */ l("p", {
|
|
236
|
+
className: "text-2xl font-bold text-foreground",
|
|
237
|
+
children: B
|
|
238
|
+
})]
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ u("div", {
|
|
241
|
+
className: "rounded-lg border border-border bg-card p-4 shadow-sm",
|
|
242
|
+
children: [/* @__PURE__ */ l("p", {
|
|
243
|
+
className: "text-xs text-muted-foreground",
|
|
244
|
+
children: "Available"
|
|
245
|
+
}), /* @__PURE__ */ l("p", {
|
|
246
|
+
className: "text-2xl font-bold text-green-600 dark:text-green-400",
|
|
247
|
+
children: V
|
|
248
|
+
})]
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ u("div", {
|
|
251
|
+
className: "rounded-lg border border-border bg-card p-4 shadow-sm",
|
|
252
|
+
children: [/* @__PURE__ */ l("p", {
|
|
253
|
+
className: "text-xs text-muted-foreground",
|
|
254
|
+
children: "Out of Stock"
|
|
255
|
+
}), /* @__PURE__ */ l("p", {
|
|
256
|
+
className: "text-2xl font-bold text-red-600 dark:text-red-400",
|
|
257
|
+
children: H
|
|
258
|
+
})]
|
|
259
|
+
}),
|
|
260
|
+
/* @__PURE__ */ u("div", {
|
|
261
|
+
className: "rounded-lg border border-border bg-card p-4 shadow-sm",
|
|
262
|
+
children: [/* @__PURE__ */ l("p", {
|
|
263
|
+
className: "text-xs text-muted-foreground",
|
|
264
|
+
children: "Low Stock"
|
|
265
|
+
}), /* @__PURE__ */ l("p", {
|
|
266
|
+
className: "text-2xl font-bold text-yellow-600 dark:text-yellow-400",
|
|
267
|
+
children: U
|
|
268
|
+
})]
|
|
269
|
+
})
|
|
270
|
+
]
|
|
271
|
+
}),
|
|
272
|
+
/* @__PURE__ */ u("div", {
|
|
273
|
+
className: "rounded-lg border border-border bg-card p-4 shadow-sm space-y-4",
|
|
274
|
+
children: [/* @__PURE__ */ u("div", {
|
|
275
|
+
className: "flex flex-col lg:flex-row lg:items-center lg:justify-between gap-3",
|
|
276
|
+
children: [/* @__PURE__ */ u("div", {
|
|
277
|
+
className: "flex flex-wrap gap-2",
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ u("button", {
|
|
280
|
+
type: "button",
|
|
281
|
+
onClick: G,
|
|
282
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-sm font-medium text-foreground hover:bg-accent/80 transition-colors",
|
|
283
|
+
children: [/* @__PURE__ */ l(c, { className: "h-4 w-4" }), "Add Item"]
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ l("button", {
|
|
286
|
+
type: "button",
|
|
287
|
+
onClick: () => Y("enable"),
|
|
288
|
+
className: "rounded-md border border-border px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors",
|
|
289
|
+
children: "Enable All"
|
|
290
|
+
}),
|
|
291
|
+
/* @__PURE__ */ l("button", {
|
|
292
|
+
type: "button",
|
|
293
|
+
onClick: () => Y("disable"),
|
|
294
|
+
className: "rounded-md border border-border px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors",
|
|
295
|
+
children: "Disable All"
|
|
296
|
+
})
|
|
297
|
+
]
|
|
298
|
+
}), /* @__PURE__ */ u("button", {
|
|
299
|
+
type: "button",
|
|
300
|
+
onClick: () => alert("Import/Export feature coming soon!"),
|
|
301
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors",
|
|
302
|
+
children: [/* @__PURE__ */ l(ae, { className: "h-4 w-4" }), "Import/Export"]
|
|
303
|
+
})]
|
|
304
|
+
}), /* @__PURE__ */ u("div", {
|
|
305
|
+
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",
|
|
306
|
+
children: [
|
|
307
|
+
/* @__PURE__ */ u("div", {
|
|
308
|
+
className: "relative sm:col-span-2 lg:col-span-1",
|
|
309
|
+
children: [/* @__PURE__ */ l(re, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ l("input", {
|
|
310
|
+
type: "text",
|
|
311
|
+
placeholder: "Search offerings...",
|
|
312
|
+
value: _,
|
|
313
|
+
onChange: (e) => v(e.target.value),
|
|
314
|
+
className: "w-full rounded-md border border-border bg-card pl-10 pr-4 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
315
|
+
})]
|
|
316
|
+
}),
|
|
317
|
+
/* @__PURE__ */ u("select", {
|
|
318
|
+
value: y,
|
|
319
|
+
onChange: (e) => b(e.target.value),
|
|
320
|
+
className: "rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground",
|
|
321
|
+
children: [/* @__PURE__ */ l("option", {
|
|
322
|
+
value: "",
|
|
323
|
+
children: "All Categories"
|
|
324
|
+
}), R.map((e) => /* @__PURE__ */ l("option", {
|
|
325
|
+
value: e,
|
|
326
|
+
children: e
|
|
327
|
+
}, e))]
|
|
328
|
+
}),
|
|
329
|
+
/* @__PURE__ */ u("select", {
|
|
330
|
+
value: x,
|
|
331
|
+
onChange: (e) => S(e.target.value),
|
|
332
|
+
className: "rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground",
|
|
333
|
+
children: [
|
|
334
|
+
/* @__PURE__ */ l("option", {
|
|
335
|
+
value: "",
|
|
336
|
+
children: "All Status"
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ l("option", {
|
|
339
|
+
value: "available",
|
|
340
|
+
children: "Available"
|
|
341
|
+
}),
|
|
342
|
+
/* @__PURE__ */ l("option", {
|
|
343
|
+
value: "unavailable",
|
|
344
|
+
children: "Unavailable"
|
|
345
|
+
})
|
|
346
|
+
]
|
|
347
|
+
}),
|
|
348
|
+
/* @__PURE__ */ u("select", {
|
|
349
|
+
value: C,
|
|
350
|
+
onChange: (e) => w(e.target.value),
|
|
351
|
+
className: "rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground",
|
|
352
|
+
children: [
|
|
353
|
+
/* @__PURE__ */ l("option", {
|
|
354
|
+
value: "name",
|
|
355
|
+
children: "Name A-Z"
|
|
356
|
+
}),
|
|
357
|
+
/* @__PURE__ */ l("option", {
|
|
358
|
+
value: "price_low",
|
|
359
|
+
children: "Price: Low to High"
|
|
360
|
+
}),
|
|
361
|
+
/* @__PURE__ */ l("option", {
|
|
362
|
+
value: "price_high",
|
|
363
|
+
children: "Price: High to Low"
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ l("option", {
|
|
366
|
+
value: "stock",
|
|
367
|
+
children: "Stock: Low to High"
|
|
368
|
+
})
|
|
369
|
+
]
|
|
370
|
+
})
|
|
371
|
+
]
|
|
372
|
+
})]
|
|
373
|
+
}),
|
|
374
|
+
z.length === 0 ? /* @__PURE__ */ u("div", {
|
|
375
|
+
className: "rounded-lg border border-border bg-card p-12 text-center shadow-sm",
|
|
376
|
+
children: [
|
|
377
|
+
/* @__PURE__ */ l(s, { className: "h-12 w-12 text-muted-foreground opacity-40 mx-auto mb-3" }),
|
|
378
|
+
/* @__PURE__ */ l("h3", {
|
|
379
|
+
className: "text-lg font-semibold text-foreground mb-2",
|
|
380
|
+
children: "No Items Found"
|
|
381
|
+
}),
|
|
382
|
+
/* @__PURE__ */ l("p", {
|
|
383
|
+
className: "text-sm text-muted-foreground mb-4",
|
|
384
|
+
children: _ || y || x ? "No items match your current filters. Try adjusting your search criteria." : "You haven't added any items yet. Start building your offerings!"
|
|
385
|
+
}),
|
|
386
|
+
/* @__PURE__ */ u("div", {
|
|
387
|
+
className: "flex flex-wrap justify-center gap-3",
|
|
388
|
+
children: [/* @__PURE__ */ u("button", {
|
|
389
|
+
type: "button",
|
|
390
|
+
onClick: G,
|
|
391
|
+
className: "inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-foreground hover:bg-accent/80",
|
|
392
|
+
children: [/* @__PURE__ */ l(c, { className: "h-4 w-4" }), "Add Your First Item"]
|
|
393
|
+
}), (_ || y || x) && /* @__PURE__ */ l("button", {
|
|
394
|
+
type: "button",
|
|
395
|
+
onClick: () => {
|
|
396
|
+
v(""), b(""), S(""), w("name");
|
|
397
|
+
},
|
|
398
|
+
className: "rounded-md border border-border px-4 py-2 text-sm text-foreground hover:bg-muted",
|
|
399
|
+
children: "Clear Filters"
|
|
400
|
+
})]
|
|
401
|
+
})
|
|
402
|
+
]
|
|
403
|
+
}) : /* @__PURE__ */ u(se, { children: [/* @__PURE__ */ l("div", {
|
|
404
|
+
className: "hidden lg:block rounded-lg border border-border bg-card shadow-sm overflow-hidden",
|
|
405
|
+
children: /* @__PURE__ */ l("div", {
|
|
406
|
+
className: "overflow-x-auto",
|
|
407
|
+
children: /* @__PURE__ */ u("table", {
|
|
408
|
+
className: "w-full text-sm",
|
|
409
|
+
children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ u("tr", {
|
|
410
|
+
className: "border-b border-border bg-muted/50",
|
|
411
|
+
children: [
|
|
412
|
+
/* @__PURE__ */ l("th", {
|
|
413
|
+
className: "px-5 py-3 text-left font-medium text-muted-foreground",
|
|
414
|
+
children: "Item"
|
|
415
|
+
}),
|
|
416
|
+
/* @__PURE__ */ l("th", {
|
|
417
|
+
className: "px-5 py-3 text-left font-medium text-muted-foreground",
|
|
418
|
+
children: "Category"
|
|
419
|
+
}),
|
|
420
|
+
/* @__PURE__ */ l("th", {
|
|
421
|
+
className: "px-5 py-3 text-right font-medium text-muted-foreground",
|
|
422
|
+
children: "Price"
|
|
423
|
+
}),
|
|
424
|
+
/* @__PURE__ */ l("th", {
|
|
425
|
+
className: "px-5 py-3 text-left font-medium text-muted-foreground",
|
|
426
|
+
children: "Stock/Status"
|
|
427
|
+
}),
|
|
428
|
+
/* @__PURE__ */ l("th", {
|
|
429
|
+
className: "px-5 py-3 text-center font-medium text-muted-foreground",
|
|
430
|
+
children: "Available"
|
|
431
|
+
}),
|
|
432
|
+
/* @__PURE__ */ l("th", {
|
|
433
|
+
className: "px-5 py-3 text-right font-medium text-muted-foreground",
|
|
434
|
+
children: "Actions"
|
|
435
|
+
})
|
|
436
|
+
]
|
|
437
|
+
}) }), /* @__PURE__ */ l("tbody", { children: z.map((e) => {
|
|
438
|
+
let n = X(e);
|
|
439
|
+
return /* @__PURE__ */ u("tr", {
|
|
440
|
+
className: "border-b border-border last:border-0 hover:bg-muted/30 transition-colors",
|
|
441
|
+
children: [
|
|
442
|
+
/* @__PURE__ */ l("td", {
|
|
443
|
+
className: "px-5 py-3",
|
|
444
|
+
children: /* @__PURE__ */ u("div", {
|
|
445
|
+
className: "flex items-center gap-3",
|
|
446
|
+
children: [/* @__PURE__ */ l("div", {
|
|
447
|
+
className: "flex h-10 w-10 items-center justify-center rounded-md bg-muted",
|
|
448
|
+
children: /* @__PURE__ */ l(s, { className: "h-4 w-4 text-muted-foreground" })
|
|
449
|
+
}), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
450
|
+
className: "font-medium text-foreground",
|
|
451
|
+
children: e.name
|
|
452
|
+
}), /* @__PURE__ */ u("p", {
|
|
453
|
+
className: "text-xs text-muted-foreground line-clamp-1",
|
|
454
|
+
children: [e.description.slice(0, 50), "..."]
|
|
455
|
+
})] })]
|
|
456
|
+
})
|
|
457
|
+
}),
|
|
458
|
+
/* @__PURE__ */ l("td", {
|
|
459
|
+
className: "px-5 py-3",
|
|
460
|
+
children: /* @__PURE__ */ l("span", {
|
|
461
|
+
className: "inline-flex rounded-full bg-muted px-2.5 py-0.5 text-xs font-medium text-muted-foreground",
|
|
462
|
+
children: e.category
|
|
463
|
+
})
|
|
464
|
+
}),
|
|
465
|
+
/* @__PURE__ */ u("td", {
|
|
466
|
+
className: "px-5 py-3 text-right",
|
|
467
|
+
children: [/* @__PURE__ */ l("p", {
|
|
468
|
+
className: "font-medium text-foreground",
|
|
469
|
+
children: r(e.price, { minimumFractionDigits: 0 })
|
|
470
|
+
}), e.originalPrice && /* @__PURE__ */ l("p", {
|
|
471
|
+
className: "text-xs text-muted-foreground line-through",
|
|
472
|
+
children: r(e.originalPrice, { minimumFractionDigits: 0 })
|
|
473
|
+
})]
|
|
474
|
+
}),
|
|
475
|
+
/* @__PURE__ */ l("td", {
|
|
476
|
+
className: "px-5 py-3",
|
|
477
|
+
children: /* @__PURE__ */ l("span", {
|
|
478
|
+
className: t("text-sm font-medium", n.color),
|
|
479
|
+
children: n.label
|
|
480
|
+
})
|
|
481
|
+
}),
|
|
482
|
+
/* @__PURE__ */ l("td", {
|
|
483
|
+
className: "px-5 py-3 text-center",
|
|
484
|
+
children: /* @__PURE__ */ l("button", {
|
|
485
|
+
type: "button",
|
|
486
|
+
onClick: () => J(e.id, !e.isAvailable),
|
|
487
|
+
className: t("h-6 w-11 rounded-full transition-colors relative inline-block", e.isAvailable ? "bg-blue-500" : "bg-muted-foreground/30"),
|
|
488
|
+
children: /* @__PURE__ */ l("div", { className: t("absolute top-0.5 h-5 w-5 rounded-full bg-white transition-transform", e.isAvailable ? "translate-x-5" : "translate-x-0.5") })
|
|
489
|
+
})
|
|
490
|
+
}),
|
|
491
|
+
/* @__PURE__ */ l("td", {
|
|
492
|
+
className: "px-5 py-3",
|
|
493
|
+
children: /* @__PURE__ */ u("div", {
|
|
494
|
+
className: "flex items-center justify-end gap-1",
|
|
495
|
+
children: [/* @__PURE__ */ l("button", {
|
|
496
|
+
type: "button",
|
|
497
|
+
onClick: () => K(e),
|
|
498
|
+
className: "rounded p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",
|
|
499
|
+
title: "Edit",
|
|
500
|
+
children: /* @__PURE__ */ l(ne, { className: "h-4 w-4" })
|
|
501
|
+
}), /* @__PURE__ */ l("button", {
|
|
502
|
+
type: "button",
|
|
503
|
+
onClick: () => q(e.id),
|
|
504
|
+
className: "rounded p-1.5 text-muted-foreground hover:bg-red-500/10 hover:text-red-600 transition-colors",
|
|
505
|
+
title: "Delete",
|
|
506
|
+
children: /* @__PURE__ */ l(ie, { className: "h-4 w-4" })
|
|
507
|
+
})]
|
|
508
|
+
})
|
|
509
|
+
})
|
|
510
|
+
]
|
|
511
|
+
}, e.id);
|
|
512
|
+
}) })]
|
|
513
|
+
})
|
|
514
|
+
})
|
|
515
|
+
}), /* @__PURE__ */ l("div", {
|
|
516
|
+
className: "lg:hidden space-y-3",
|
|
517
|
+
children: z.map((e) => {
|
|
518
|
+
let n = X(e);
|
|
519
|
+
return /* @__PURE__ */ l("div", {
|
|
520
|
+
className: "rounded-lg border border-border bg-card p-4 shadow-sm",
|
|
521
|
+
children: /* @__PURE__ */ u("div", {
|
|
522
|
+
className: "flex items-start gap-3",
|
|
523
|
+
children: [/* @__PURE__ */ l("div", {
|
|
524
|
+
className: "flex h-14 w-14 items-center justify-center rounded-md bg-muted shrink-0",
|
|
525
|
+
children: /* @__PURE__ */ l(s, { className: "h-6 w-6 text-muted-foreground" })
|
|
526
|
+
}), /* @__PURE__ */ u("div", {
|
|
527
|
+
className: "flex-1 min-w-0",
|
|
528
|
+
children: [
|
|
529
|
+
/* @__PURE__ */ u("div", {
|
|
530
|
+
className: "flex items-start justify-between mb-1",
|
|
531
|
+
children: [/* @__PURE__ */ u("div", {
|
|
532
|
+
className: "flex-1",
|
|
533
|
+
children: [/* @__PURE__ */ l("h3", {
|
|
534
|
+
className: "text-sm font-medium text-foreground line-clamp-1",
|
|
535
|
+
children: e.name
|
|
536
|
+
}), /* @__PURE__ */ l("p", {
|
|
537
|
+
className: "text-xs text-muted-foreground mt-0.5 line-clamp-2",
|
|
538
|
+
children: e.description
|
|
539
|
+
})]
|
|
540
|
+
}), /* @__PURE__ */ l("button", {
|
|
541
|
+
type: "button",
|
|
542
|
+
onClick: () => J(e.id, !e.isAvailable),
|
|
543
|
+
className: t("h-5 w-9 rounded-full transition-colors relative ml-2 shrink-0", e.isAvailable ? "bg-blue-500" : "bg-muted-foreground/30"),
|
|
544
|
+
children: /* @__PURE__ */ l("div", { className: t("absolute top-0.5 h-4 w-4 rounded-full bg-white transition-transform", e.isAvailable ? "translate-x-4" : "translate-x-0.5") })
|
|
545
|
+
})]
|
|
546
|
+
}),
|
|
547
|
+
/* @__PURE__ */ u("div", {
|
|
548
|
+
className: "flex flex-wrap items-center gap-2 mt-2 text-xs",
|
|
549
|
+
children: [/* @__PURE__ */ l("span", {
|
|
550
|
+
className: "px-2 py-0.5 rounded-full bg-muted text-muted-foreground",
|
|
551
|
+
children: e.category
|
|
552
|
+
}), /* @__PURE__ */ l("span", {
|
|
553
|
+
className: t("font-medium", n.color),
|
|
554
|
+
children: n.label
|
|
555
|
+
})]
|
|
556
|
+
}),
|
|
557
|
+
/* @__PURE__ */ u("div", {
|
|
558
|
+
className: "flex items-center justify-between mt-3",
|
|
559
|
+
children: [/* @__PURE__ */ u("div", {
|
|
560
|
+
className: "flex items-center gap-2",
|
|
561
|
+
children: [/* @__PURE__ */ l("span", {
|
|
562
|
+
className: "font-semibold text-foreground",
|
|
563
|
+
children: r(e.price, { minimumFractionDigits: 0 })
|
|
564
|
+
}), e.originalPrice && /* @__PURE__ */ l("span", {
|
|
565
|
+
className: "text-xs text-muted-foreground line-through",
|
|
566
|
+
children: r(e.originalPrice, { minimumFractionDigits: 0 })
|
|
567
|
+
})]
|
|
568
|
+
}), /* @__PURE__ */ u("div", {
|
|
569
|
+
className: "flex gap-1",
|
|
570
|
+
children: [/* @__PURE__ */ l("button", {
|
|
571
|
+
type: "button",
|
|
572
|
+
onClick: () => K(e),
|
|
573
|
+
className: "rounded px-2 py-1 text-xs border border-border text-foreground hover:bg-muted",
|
|
574
|
+
children: "Edit"
|
|
575
|
+
}), /* @__PURE__ */ l("button", {
|
|
576
|
+
type: "button",
|
|
577
|
+
onClick: () => q(e.id),
|
|
578
|
+
className: "rounded px-2 py-1 text-xs border border-border text-red-600 dark:text-red-400 hover:bg-red-500/10",
|
|
579
|
+
children: "Delete"
|
|
580
|
+
})]
|
|
581
|
+
})]
|
|
582
|
+
})
|
|
583
|
+
]
|
|
584
|
+
})]
|
|
585
|
+
})
|
|
586
|
+
}, e.id);
|
|
587
|
+
})
|
|
588
|
+
})] })
|
|
589
|
+
]
|
|
590
|
+
}), ue && /* @__PURE__ */ l("div", {
|
|
591
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
|
|
592
|
+
children: /* @__PURE__ */ l("div", {
|
|
593
|
+
className: "w-full max-w-2xl max-h-[90vh] overflow-y-auto rounded-lg border border-border bg-card shadow-xl",
|
|
594
|
+
children: /* @__PURE__ */ u("div", {
|
|
595
|
+
className: "p-6",
|
|
596
|
+
children: [
|
|
597
|
+
/* @__PURE__ */ u("div", {
|
|
598
|
+
className: "flex items-center justify-between mb-4",
|
|
599
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h3", {
|
|
600
|
+
className: "text-lg font-semibold text-foreground",
|
|
601
|
+
children: E ? "Edit Item" : "Add New Item"
|
|
602
|
+
}), O.category && /* @__PURE__ */ u("p", {
|
|
603
|
+
className: "text-sm text-muted-foreground mt-0.5",
|
|
604
|
+
children: [
|
|
605
|
+
"Type: ",
|
|
606
|
+
Z ? "Service" : "Product",
|
|
607
|
+
" | Category: ",
|
|
608
|
+
O.category
|
|
609
|
+
]
|
|
610
|
+
})] }), /* @__PURE__ */ l("button", {
|
|
611
|
+
type: "button",
|
|
612
|
+
onClick: () => T(!1),
|
|
613
|
+
className: "rounded p-1.5 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
614
|
+
children: /* @__PURE__ */ l(oe, { className: "h-5 w-5" })
|
|
615
|
+
})]
|
|
616
|
+
}),
|
|
617
|
+
/* @__PURE__ */ u("div", {
|
|
618
|
+
className: "space-y-4",
|
|
619
|
+
children: [
|
|
620
|
+
/* @__PURE__ */ u("div", {
|
|
621
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
622
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
623
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
624
|
+
children: "Item Name *"
|
|
625
|
+
}), /* @__PURE__ */ l("input", {
|
|
626
|
+
type: "text",
|
|
627
|
+
value: O.name,
|
|
628
|
+
onChange: (e) => k((t) => ({
|
|
629
|
+
...t,
|
|
630
|
+
name: e.target.value
|
|
631
|
+
})),
|
|
632
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground",
|
|
633
|
+
placeholder: "Enter item name"
|
|
634
|
+
})] }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
635
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
636
|
+
children: "Category *"
|
|
637
|
+
}), /* @__PURE__ */ u("select", {
|
|
638
|
+
value: O.category,
|
|
639
|
+
onChange: (e) => k((t) => ({
|
|
640
|
+
...t,
|
|
641
|
+
category: e.target.value
|
|
642
|
+
})),
|
|
643
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground",
|
|
644
|
+
children: [/* @__PURE__ */ l("option", {
|
|
645
|
+
value: "",
|
|
646
|
+
children: "Select category"
|
|
647
|
+
}), R.map((e) => /* @__PURE__ */ l("option", {
|
|
648
|
+
value: e,
|
|
649
|
+
children: e
|
|
650
|
+
}, e))]
|
|
651
|
+
})] })]
|
|
652
|
+
}),
|
|
653
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
654
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
655
|
+
children: "Description *"
|
|
656
|
+
}), /* @__PURE__ */ l("textarea", {
|
|
657
|
+
value: O.description,
|
|
658
|
+
onChange: (e) => k((t) => ({
|
|
659
|
+
...t,
|
|
660
|
+
description: e.target.value
|
|
661
|
+
})),
|
|
662
|
+
rows: 3,
|
|
663
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground resize-none",
|
|
664
|
+
placeholder: "Describe the offering..."
|
|
665
|
+
})] }),
|
|
666
|
+
/* @__PURE__ */ u("div", {
|
|
667
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
668
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
669
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
670
|
+
children: "Price *"
|
|
671
|
+
}), /* @__PURE__ */ l("input", {
|
|
672
|
+
type: "number",
|
|
673
|
+
value: O.price,
|
|
674
|
+
onChange: (e) => k((t) => ({
|
|
675
|
+
...t,
|
|
676
|
+
price: parseInt(e.target.value) || 0
|
|
677
|
+
})),
|
|
678
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground"
|
|
679
|
+
})] }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
680
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
681
|
+
children: "Original Price"
|
|
682
|
+
}), /* @__PURE__ */ l("input", {
|
|
683
|
+
type: "number",
|
|
684
|
+
value: O.originalPrice ?? "",
|
|
685
|
+
onChange: (e) => k((t) => ({
|
|
686
|
+
...t,
|
|
687
|
+
originalPrice: e.target.value ? parseInt(e.target.value) : void 0
|
|
688
|
+
})),
|
|
689
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground",
|
|
690
|
+
placeholder: "Optional"
|
|
691
|
+
})] })]
|
|
692
|
+
}),
|
|
693
|
+
!Z && /* @__PURE__ */ u("div", {
|
|
694
|
+
className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
|
|
695
|
+
children: [
|
|
696
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
697
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
698
|
+
children: "Stock Quantity *"
|
|
699
|
+
}), /* @__PURE__ */ l("input", {
|
|
700
|
+
type: "number",
|
|
701
|
+
value: O.stock,
|
|
702
|
+
onChange: (e) => k((t) => ({
|
|
703
|
+
...t,
|
|
704
|
+
stock: parseInt(e.target.value) || 0
|
|
705
|
+
})),
|
|
706
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground"
|
|
707
|
+
})] }),
|
|
708
|
+
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
709
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
710
|
+
children: "Preparation Time (min)"
|
|
711
|
+
}), /* @__PURE__ */ l("input", {
|
|
712
|
+
type: "number",
|
|
713
|
+
value: O.preparationTime,
|
|
714
|
+
onChange: (e) => k((t) => ({
|
|
715
|
+
...t,
|
|
716
|
+
preparationTime: parseInt(e.target.value) || 0
|
|
717
|
+
})),
|
|
718
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground"
|
|
719
|
+
})] }),
|
|
720
|
+
Q && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
721
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
722
|
+
children: "Calories"
|
|
723
|
+
}), /* @__PURE__ */ l("input", {
|
|
724
|
+
type: "number",
|
|
725
|
+
value: O.calories,
|
|
726
|
+
onChange: (e) => k((t) => ({
|
|
727
|
+
...t,
|
|
728
|
+
calories: parseInt(e.target.value) || 0
|
|
729
|
+
})),
|
|
730
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground"
|
|
731
|
+
})] })
|
|
732
|
+
]
|
|
733
|
+
}),
|
|
734
|
+
Z && /* @__PURE__ */ u("div", {
|
|
735
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
736
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
737
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
738
|
+
children: "Service Duration (min) *"
|
|
739
|
+
}), /* @__PURE__ */ l("input", {
|
|
740
|
+
type: "number",
|
|
741
|
+
value: O.duration,
|
|
742
|
+
onChange: (e) => k((t) => ({
|
|
743
|
+
...t,
|
|
744
|
+
duration: parseInt(e.target.value) || 30
|
|
745
|
+
})),
|
|
746
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground"
|
|
747
|
+
})] }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
748
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
749
|
+
children: "Setup Time (min)"
|
|
750
|
+
}), /* @__PURE__ */ l("input", {
|
|
751
|
+
type: "number",
|
|
752
|
+
value: O.preparationTime,
|
|
753
|
+
onChange: (e) => k((t) => ({
|
|
754
|
+
...t,
|
|
755
|
+
preparationTime: parseInt(e.target.value) || 0
|
|
756
|
+
})),
|
|
757
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground"
|
|
758
|
+
})] })]
|
|
759
|
+
}),
|
|
760
|
+
Q && /* @__PURE__ */ u("div", {
|
|
761
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
762
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
763
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
764
|
+
children: "Spice Level"
|
|
765
|
+
}), /* @__PURE__ */ u("select", {
|
|
766
|
+
value: O.spiceLevel,
|
|
767
|
+
onChange: (e) => k((t) => ({
|
|
768
|
+
...t,
|
|
769
|
+
spiceLevel: e.target.value
|
|
770
|
+
})),
|
|
771
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground",
|
|
772
|
+
children: [
|
|
773
|
+
/* @__PURE__ */ l("option", {
|
|
774
|
+
value: "none",
|
|
775
|
+
children: "None"
|
|
776
|
+
}),
|
|
777
|
+
/* @__PURE__ */ l("option", {
|
|
778
|
+
value: "mild",
|
|
779
|
+
children: "Mild"
|
|
780
|
+
}),
|
|
781
|
+
/* @__PURE__ */ l("option", {
|
|
782
|
+
value: "medium",
|
|
783
|
+
children: "Medium"
|
|
784
|
+
}),
|
|
785
|
+
/* @__PURE__ */ l("option", {
|
|
786
|
+
value: "spicy",
|
|
787
|
+
children: "Spicy"
|
|
788
|
+
}),
|
|
789
|
+
/* @__PURE__ */ l("option", {
|
|
790
|
+
value: "very-spicy",
|
|
791
|
+
children: "Very Spicy"
|
|
792
|
+
})
|
|
793
|
+
]
|
|
794
|
+
})] }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
795
|
+
className: "block text-sm font-medium text-foreground mb-2",
|
|
796
|
+
children: "Dietary Options"
|
|
797
|
+
}), /* @__PURE__ */ l("div", {
|
|
798
|
+
className: "space-y-2",
|
|
799
|
+
children: [
|
|
800
|
+
"isVegetarian",
|
|
801
|
+
"isVegan",
|
|
802
|
+
"isGlutenFree"
|
|
803
|
+
].map((e) => /* @__PURE__ */ u("label", {
|
|
804
|
+
className: "flex items-center gap-2 text-sm text-foreground",
|
|
805
|
+
children: [/* @__PURE__ */ l("input", {
|
|
806
|
+
type: "checkbox",
|
|
807
|
+
checked: O[e],
|
|
808
|
+
onChange: (t) => k((n) => ({
|
|
809
|
+
...n,
|
|
810
|
+
[e]: t.target.checked
|
|
811
|
+
})),
|
|
812
|
+
className: "rounded border-border"
|
|
813
|
+
}), e === "isVegetarian" ? "Vegetarian" : e === "isVegan" ? "Vegan" : "Gluten Free"]
|
|
814
|
+
}, e))
|
|
815
|
+
})] })]
|
|
816
|
+
}),
|
|
817
|
+
Z && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
818
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
819
|
+
children: "Service Type *"
|
|
820
|
+
}), /* @__PURE__ */ u("select", {
|
|
821
|
+
value: O.serviceType,
|
|
822
|
+
onChange: (e) => k((t) => ({
|
|
823
|
+
...t,
|
|
824
|
+
serviceType: e.target.value
|
|
825
|
+
})),
|
|
826
|
+
className: "w-full sm:w-64 rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground",
|
|
827
|
+
children: [
|
|
828
|
+
/* @__PURE__ */ l("option", {
|
|
829
|
+
value: "instant",
|
|
830
|
+
children: "Instant Service"
|
|
831
|
+
}),
|
|
832
|
+
/* @__PURE__ */ l("option", {
|
|
833
|
+
value: "appointment",
|
|
834
|
+
children: "Appointment Based"
|
|
835
|
+
}),
|
|
836
|
+
/* @__PURE__ */ l("option", {
|
|
837
|
+
value: "recurring",
|
|
838
|
+
children: "Recurring Service"
|
|
839
|
+
}),
|
|
840
|
+
/* @__PURE__ */ l("option", {
|
|
841
|
+
value: "consultation",
|
|
842
|
+
children: "Consultation"
|
|
843
|
+
})
|
|
844
|
+
]
|
|
845
|
+
})] }),
|
|
846
|
+
/* @__PURE__ */ u("div", { children: [
|
|
847
|
+
/* @__PURE__ */ l("label", {
|
|
848
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
849
|
+
children: "Tags (comma separated)"
|
|
850
|
+
}),
|
|
851
|
+
/* @__PURE__ */ l("input", {
|
|
852
|
+
type: "text",
|
|
853
|
+
value: A,
|
|
854
|
+
onChange: (e) => j(e.target.value),
|
|
855
|
+
placeholder: Z ? "professional, certified, quick" : "popular, spicy, traditional",
|
|
856
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground"
|
|
857
|
+
}),
|
|
858
|
+
/* @__PURE__ */ u("p", {
|
|
859
|
+
className: "text-xs text-muted-foreground mt-1",
|
|
860
|
+
children: [
|
|
861
|
+
A.split(",").map((e) => e.trim()).filter(Boolean).length,
|
|
862
|
+
" ",
|
|
863
|
+
"tags"
|
|
864
|
+
]
|
|
865
|
+
})
|
|
866
|
+
] }),
|
|
867
|
+
Q && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
868
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
869
|
+
children: "Allergens (comma separated)"
|
|
870
|
+
}), /* @__PURE__ */ l("input", {
|
|
871
|
+
type: "text",
|
|
872
|
+
value: M,
|
|
873
|
+
onChange: (e) => N(e.target.value),
|
|
874
|
+
placeholder: "nuts, dairy, gluten, soy",
|
|
875
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground"
|
|
876
|
+
})] }),
|
|
877
|
+
Z && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
|
|
878
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
879
|
+
children: "Service Requirements (comma separated)"
|
|
880
|
+
}), /* @__PURE__ */ l("input", {
|
|
881
|
+
type: "text",
|
|
882
|
+
value: P,
|
|
883
|
+
onChange: (e) => F(e.target.value),
|
|
884
|
+
placeholder: "advance booking, payment required, tools provided",
|
|
885
|
+
className: "w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground"
|
|
886
|
+
})] })
|
|
887
|
+
]
|
|
888
|
+
}),
|
|
889
|
+
/* @__PURE__ */ u("div", {
|
|
890
|
+
className: "flex gap-3 mt-6",
|
|
891
|
+
children: [/* @__PURE__ */ l("button", {
|
|
892
|
+
type: "button",
|
|
893
|
+
onClick: () => T(!1),
|
|
894
|
+
className: "flex-1 rounded-md border border-border px-4 py-2 text-sm font-medium text-foreground hover:bg-muted transition-colors",
|
|
895
|
+
children: "Cancel"
|
|
896
|
+
}), /* @__PURE__ */ l("button", {
|
|
897
|
+
type: "button",
|
|
898
|
+
onClick: de,
|
|
899
|
+
disabled: !$,
|
|
900
|
+
className: t("flex-1 rounded-md px-4 py-2 text-sm font-medium transition-colors", $ ? "bg-accent text-foreground hover:bg-accent/80" : "bg-muted text-muted-foreground cursor-not-allowed"),
|
|
901
|
+
children: E ? "Update Item" : "Add Item"
|
|
902
|
+
})]
|
|
903
|
+
})
|
|
904
|
+
]
|
|
905
|
+
})
|
|
906
|
+
})
|
|
907
|
+
})]
|
|
908
|
+
});
|
|
909
|
+
};
|
|
910
|
+
//#endregion
|
|
911
|
+
export { _ as InventoryManagementPage };
|
|
912
|
+
|
|
913
|
+
//# sourceMappingURL=InventoryManagementPage.js.map
|