@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,578 @@
|
|
|
1
|
+
import { useAdapterCloud as e } from "../../context/AdapterCloudContext.js";
|
|
2
|
+
import { cn as t } from "../../utils/cn.js";
|
|
3
|
+
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
+
import { EmptyState as r } from "../../components/EmptyState.js";
|
|
5
|
+
import { formatCurrency as i } from "../../utils/formatters.js";
|
|
6
|
+
import { useEffect as a, useMemo as o, useState as s } from "react";
|
|
7
|
+
import { Calendar as c, CalendarDays as l, CheckCircle2 as u, ChevronLeft as d, ChevronRight as f, Loader2 as p, LogIn as m, LogOut as h, MapPin as g, PlayCircle as _, Save as v, Send as y, ShoppingCart as b, Star as x, Timer as S } from "lucide-react";
|
|
8
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
9
|
+
//#region src/adaptercloud/pages/worker/WorkerSchedulePage.tsx
|
|
10
|
+
function T(e) {
|
|
11
|
+
return new Date(e).toLocaleDateString("en-US", {
|
|
12
|
+
weekday: "short",
|
|
13
|
+
month: "short",
|
|
14
|
+
day: "numeric"
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function E(e) {
|
|
18
|
+
let [t, n] = e.split(":"), r = parseInt(t), i = r >= 12 ? "PM" : "AM";
|
|
19
|
+
return `${r % 12 || 12}:${n} ${i}`;
|
|
20
|
+
}
|
|
21
|
+
function D(e) {
|
|
22
|
+
let t = /* @__PURE__ */ new Date(), n = t.getDay(), r = new Date(t);
|
|
23
|
+
r.setDate(t.getDate() - n + e * 7);
|
|
24
|
+
let i = new Date(r);
|
|
25
|
+
return i.setDate(r.getDate() + 6), {
|
|
26
|
+
start: r.toLocaleDateString("en-US", {
|
|
27
|
+
month: "short",
|
|
28
|
+
day: "numeric"
|
|
29
|
+
}),
|
|
30
|
+
end: i.toLocaleDateString("en-US", {
|
|
31
|
+
month: "short",
|
|
32
|
+
day: "numeric",
|
|
33
|
+
year: "numeric"
|
|
34
|
+
})
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function O(e) {
|
|
38
|
+
switch (e) {
|
|
39
|
+
case "scheduled": return "bg-blue-500/20 text-blue-600 dark:text-blue-400";
|
|
40
|
+
case "ongoing": return "bg-green-500/20 text-green-600 dark:text-green-400";
|
|
41
|
+
case "completed": return "bg-secondary text-secondary-foreground";
|
|
42
|
+
case "cancelled": return "bg-red-500/20 text-red-600 dark:text-red-400";
|
|
43
|
+
default: return "bg-secondary text-secondary-foreground";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function k(e) {
|
|
47
|
+
switch (e) {
|
|
48
|
+
case "pending": return "bg-yellow-500/20 text-yellow-600 dark:text-yellow-400";
|
|
49
|
+
case "approved": return "bg-green-500/20 text-green-600 dark:text-green-400";
|
|
50
|
+
case "rejected": return "bg-red-500/20 text-red-600 dark:text-red-400";
|
|
51
|
+
default: return "bg-secondary text-secondary-foreground";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
var A = () => {
|
|
55
|
+
let { navigateTo: A } = e(), [j, M] = s(!0), [N, P] = s("schedule"), [F, I] = s(0), [L, R] = s([]), [z, B] = s([]), [V, H] = s([]);
|
|
56
|
+
a(() => {
|
|
57
|
+
M(!0);
|
|
58
|
+
let e = setTimeout(() => {
|
|
59
|
+
R([
|
|
60
|
+
{
|
|
61
|
+
id: "shift-001",
|
|
62
|
+
date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
63
|
+
startTime: "09:00",
|
|
64
|
+
endTime: "14:00",
|
|
65
|
+
cartId: "cart-001",
|
|
66
|
+
cartName: "South Indian Express",
|
|
67
|
+
location: "MG Road, Bangalore",
|
|
68
|
+
status: "ongoing",
|
|
69
|
+
earnings: 1200,
|
|
70
|
+
tasksCompleted: 8
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "shift-002",
|
|
74
|
+
date: new Date(Date.now() + 1440 * 60 * 1e3).toISOString().split("T")[0],
|
|
75
|
+
startTime: "14:00",
|
|
76
|
+
endTime: "20:00",
|
|
77
|
+
cartId: "cart-002",
|
|
78
|
+
cartName: "Chaat Corner",
|
|
79
|
+
location: "Brigade Road, Bangalore",
|
|
80
|
+
status: "scheduled",
|
|
81
|
+
earnings: 1500
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "shift-003",
|
|
85
|
+
date: (/* @__PURE__ */ new Date(Date.now() - 1440 * 60 * 1e3)).toISOString().split("T")[0],
|
|
86
|
+
startTime: "10:00",
|
|
87
|
+
endTime: "16:00",
|
|
88
|
+
cartId: "cart-001",
|
|
89
|
+
cartName: "South Indian Express",
|
|
90
|
+
location: "MG Road, Bangalore",
|
|
91
|
+
status: "completed",
|
|
92
|
+
earnings: 1350,
|
|
93
|
+
tasksCompleted: 12,
|
|
94
|
+
rating: 4.8
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "shift-004",
|
|
98
|
+
date: new Date(Date.now() + 4320 * 60 * 1e3).toISOString().split("T")[0],
|
|
99
|
+
startTime: "08:00",
|
|
100
|
+
endTime: "14:00",
|
|
101
|
+
cartId: "cart-003",
|
|
102
|
+
cartName: "Biryani Pot",
|
|
103
|
+
location: "Frazer Town, Bangalore",
|
|
104
|
+
status: "scheduled",
|
|
105
|
+
earnings: 0
|
|
106
|
+
}
|
|
107
|
+
]), B([
|
|
108
|
+
{
|
|
109
|
+
id: "req-001",
|
|
110
|
+
date: new Date(Date.now() + 2880 * 60 * 1e3).toISOString().split("T")[0],
|
|
111
|
+
startTime: "08:00",
|
|
112
|
+
endTime: "14:00",
|
|
113
|
+
cartName: "Burger Bliss",
|
|
114
|
+
location: "Koramangala, Bangalore",
|
|
115
|
+
status: "pending",
|
|
116
|
+
requestedOn: (/* @__PURE__ */ new Date(Date.now() - 7200 * 1e3)).toISOString()
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "req-002",
|
|
120
|
+
date: new Date(Date.now() + 4320 * 60 * 1e3).toISOString().split("T")[0],
|
|
121
|
+
startTime: "16:00",
|
|
122
|
+
endTime: "22:00",
|
|
123
|
+
cartName: "Pizza Paradise",
|
|
124
|
+
location: "Indiranagar, Bangalore",
|
|
125
|
+
status: "approved",
|
|
126
|
+
requestedOn: (/* @__PURE__ */ new Date(Date.now() - 1440 * 60 * 1e3)).toISOString()
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: "req-003",
|
|
130
|
+
date: (/* @__PURE__ */ new Date(Date.now() - 2880 * 60 * 1e3)).toISOString().split("T")[0],
|
|
131
|
+
startTime: "10:00",
|
|
132
|
+
endTime: "16:00",
|
|
133
|
+
cartName: "Dosa Express",
|
|
134
|
+
location: "BTM Layout, Bangalore",
|
|
135
|
+
status: "rejected",
|
|
136
|
+
requestedOn: (/* @__PURE__ */ new Date(Date.now() - 4320 * 60 * 1e3)).toISOString()
|
|
137
|
+
}
|
|
138
|
+
]), H([
|
|
139
|
+
{
|
|
140
|
+
dayOfWeek: "Monday",
|
|
141
|
+
isAvailable: !0,
|
|
142
|
+
preferredStartTime: "09:00",
|
|
143
|
+
preferredEndTime: "18:00"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
dayOfWeek: "Tuesday",
|
|
147
|
+
isAvailable: !0,
|
|
148
|
+
preferredStartTime: "09:00",
|
|
149
|
+
preferredEndTime: "18:00"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
dayOfWeek: "Wednesday",
|
|
153
|
+
isAvailable: !0,
|
|
154
|
+
preferredStartTime: "09:00",
|
|
155
|
+
preferredEndTime: "18:00"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
dayOfWeek: "Thursday",
|
|
159
|
+
isAvailable: !0,
|
|
160
|
+
preferredStartTime: "09:00",
|
|
161
|
+
preferredEndTime: "18:00"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
dayOfWeek: "Friday",
|
|
165
|
+
isAvailable: !0,
|
|
166
|
+
preferredStartTime: "09:00",
|
|
167
|
+
preferredEndTime: "20:00"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
dayOfWeek: "Saturday",
|
|
171
|
+
isAvailable: !0,
|
|
172
|
+
preferredStartTime: "10:00",
|
|
173
|
+
preferredEndTime: "20:00"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
dayOfWeek: "Sunday",
|
|
177
|
+
isAvailable: !1,
|
|
178
|
+
preferredStartTime: "09:00",
|
|
179
|
+
preferredEndTime: "18:00"
|
|
180
|
+
}
|
|
181
|
+
]), M(!1);
|
|
182
|
+
}, 600);
|
|
183
|
+
return () => clearTimeout(e);
|
|
184
|
+
}, [F]);
|
|
185
|
+
let U = o(() => {
|
|
186
|
+
let e = L.filter((e) => e.status !== "cancelled"), t = e.reduce((e, t) => {
|
|
187
|
+
let n = /* @__PURE__ */ new Date(`2024-01-01T${t.startTime}`);
|
|
188
|
+
return e + ((/* @__PURE__ */ new Date(`2024-01-01T${t.endTime}`)).getTime() - n.getTime()) / (1e3 * 60 * 60);
|
|
189
|
+
}, 0), n = e.reduce((e, t) => e + t.earnings, 0), r = L.find((e) => e.status === "scheduled");
|
|
190
|
+
return {
|
|
191
|
+
hoursThisWeek: t,
|
|
192
|
+
shiftsThisWeek: e.length,
|
|
193
|
+
earningsThisWeek: n,
|
|
194
|
+
nextShift: r
|
|
195
|
+
};
|
|
196
|
+
}, [L]), W = z.filter((e) => e.status === "pending").length, G = D(F), K = (e) => {
|
|
197
|
+
R((t) => t.map((t) => t.id === e ? {
|
|
198
|
+
...t,
|
|
199
|
+
status: "ongoing"
|
|
200
|
+
} : t)), alert("Checked in successfully");
|
|
201
|
+
}, q = (e) => {
|
|
202
|
+
R((t) => t.map((t) => t.id === e ? {
|
|
203
|
+
...t,
|
|
204
|
+
status: "completed"
|
|
205
|
+
} : t)), alert("Checked out successfully");
|
|
206
|
+
}, J = (e) => {
|
|
207
|
+
B((t) => t.map((t) => t.id === e ? {
|
|
208
|
+
...t,
|
|
209
|
+
status: "approved"
|
|
210
|
+
} : t)), alert("Shift accepted");
|
|
211
|
+
}, Y = (e) => {
|
|
212
|
+
B((t) => t.map((t) => t.id === e ? {
|
|
213
|
+
...t,
|
|
214
|
+
status: "rejected"
|
|
215
|
+
} : t)), alert("Shift rejected");
|
|
216
|
+
}, X = (e, t, n) => {
|
|
217
|
+
H((r) => r.map((r) => r.dayOfWeek === e ? {
|
|
218
|
+
...r,
|
|
219
|
+
[t]: n
|
|
220
|
+
} : r));
|
|
221
|
+
};
|
|
222
|
+
return j ? /* @__PURE__ */ C(n, {
|
|
223
|
+
title: "Schedule",
|
|
224
|
+
description: "Manage your work schedule",
|
|
225
|
+
children: /* @__PURE__ */ C("div", {
|
|
226
|
+
className: "flex items-center justify-center py-24",
|
|
227
|
+
children: /* @__PURE__ */ w("div", {
|
|
228
|
+
className: "text-center",
|
|
229
|
+
children: [/* @__PURE__ */ C(p, { className: "h-10 w-10 animate-spin text-muted-foreground mx-auto mb-4" }), /* @__PURE__ */ C("p", {
|
|
230
|
+
className: "text-sm text-muted-foreground",
|
|
231
|
+
children: "Loading schedule..."
|
|
232
|
+
})]
|
|
233
|
+
})
|
|
234
|
+
})
|
|
235
|
+
}) : /* @__PURE__ */ C(n, {
|
|
236
|
+
title: "Schedule",
|
|
237
|
+
description: "Manage your work schedule",
|
|
238
|
+
children: /* @__PURE__ */ w("div", {
|
|
239
|
+
className: "space-y-6",
|
|
240
|
+
children: [/* @__PURE__ */ w("div", {
|
|
241
|
+
className: "grid grid-cols-2 md:grid-cols-4 gap-3",
|
|
242
|
+
children: [
|
|
243
|
+
/* @__PURE__ */ w("div", {
|
|
244
|
+
className: "rounded-lg border border-border bg-card p-4 shadow-sm",
|
|
245
|
+
children: [/* @__PURE__ */ C("p", {
|
|
246
|
+
className: "text-xs text-muted-foreground",
|
|
247
|
+
children: "Hours This Week"
|
|
248
|
+
}), /* @__PURE__ */ w("p", {
|
|
249
|
+
className: "text-2xl font-bold text-foreground",
|
|
250
|
+
children: [U.hoursThisWeek, "h"]
|
|
251
|
+
})]
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ w("div", {
|
|
254
|
+
className: "rounded-lg border border-border bg-card p-4 shadow-sm",
|
|
255
|
+
children: [/* @__PURE__ */ C("p", {
|
|
256
|
+
className: "text-xs text-muted-foreground",
|
|
257
|
+
children: "Shifts This Week"
|
|
258
|
+
}), /* @__PURE__ */ C("p", {
|
|
259
|
+
className: "text-2xl font-bold text-foreground",
|
|
260
|
+
children: U.shiftsThisWeek
|
|
261
|
+
})]
|
|
262
|
+
}),
|
|
263
|
+
/* @__PURE__ */ w("div", {
|
|
264
|
+
className: "rounded-lg border border-border bg-card p-4 shadow-sm",
|
|
265
|
+
children: [/* @__PURE__ */ C("p", {
|
|
266
|
+
className: "text-xs text-muted-foreground",
|
|
267
|
+
children: "Week Earnings"
|
|
268
|
+
}), /* @__PURE__ */ C("p", {
|
|
269
|
+
className: "text-2xl font-bold text-foreground",
|
|
270
|
+
children: i(U.earningsThisWeek, { minimumFractionDigits: 0 })
|
|
271
|
+
})]
|
|
272
|
+
}),
|
|
273
|
+
/* @__PURE__ */ w("div", {
|
|
274
|
+
className: "rounded-lg border border-border bg-card p-4 shadow-sm",
|
|
275
|
+
children: [/* @__PURE__ */ C("p", {
|
|
276
|
+
className: "text-xs text-muted-foreground",
|
|
277
|
+
children: "Next Shift"
|
|
278
|
+
}), /* @__PURE__ */ C("p", {
|
|
279
|
+
className: "text-sm font-bold text-foreground",
|
|
280
|
+
children: U.nextShift ? `${T(U.nextShift.date)} ${E(U.nextShift.startTime)}` : "None scheduled"
|
|
281
|
+
})]
|
|
282
|
+
})
|
|
283
|
+
]
|
|
284
|
+
}), /* @__PURE__ */ w("div", {
|
|
285
|
+
className: "rounded-lg border border-border bg-card shadow-sm overflow-hidden",
|
|
286
|
+
children: [/* @__PURE__ */ w("div", {
|
|
287
|
+
className: "flex border-b border-border",
|
|
288
|
+
children: [
|
|
289
|
+
/* @__PURE__ */ w("button", {
|
|
290
|
+
type: "button",
|
|
291
|
+
onClick: () => P("schedule"),
|
|
292
|
+
className: t("flex-1 py-3 px-4 text-sm font-medium transition-colors flex items-center justify-center gap-2", N === "schedule" ? "border-b-2 border-blue-500 text-blue-600 dark:text-blue-400 bg-blue-500/5" : "text-muted-foreground hover:text-foreground"),
|
|
293
|
+
children: [/* @__PURE__ */ C(l, { className: "h-4 w-4" }), "My Schedule"]
|
|
294
|
+
}),
|
|
295
|
+
/* @__PURE__ */ w("button", {
|
|
296
|
+
type: "button",
|
|
297
|
+
onClick: () => P("requests"),
|
|
298
|
+
className: t("flex-1 py-3 px-4 text-sm font-medium transition-colors flex items-center justify-center gap-2", N === "requests" ? "border-b-2 border-blue-500 text-blue-600 dark:text-blue-400 bg-blue-500/5" : "text-muted-foreground hover:text-foreground"),
|
|
299
|
+
children: [
|
|
300
|
+
/* @__PURE__ */ C(y, { className: "h-4 w-4" }),
|
|
301
|
+
"Shift Requests",
|
|
302
|
+
W > 0 && /* @__PURE__ */ C("span", {
|
|
303
|
+
className: "ml-1 inline-flex items-center justify-center rounded-full bg-red-500 px-1.5 py-0.5 text-[10px] font-medium text-white",
|
|
304
|
+
children: W
|
|
305
|
+
})
|
|
306
|
+
]
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ w("button", {
|
|
309
|
+
type: "button",
|
|
310
|
+
onClick: () => P("availability"),
|
|
311
|
+
className: t("flex-1 py-3 px-4 text-sm font-medium transition-colors flex items-center justify-center gap-2", N === "availability" ? "border-b-2 border-blue-500 text-blue-600 dark:text-blue-400 bg-blue-500/5" : "text-muted-foreground hover:text-foreground"),
|
|
312
|
+
children: [/* @__PURE__ */ C(S, { className: "h-4 w-4" }), "Availability"]
|
|
313
|
+
})
|
|
314
|
+
]
|
|
315
|
+
}), /* @__PURE__ */ w("div", {
|
|
316
|
+
className: "p-5",
|
|
317
|
+
children: [
|
|
318
|
+
N === "schedule" && /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("div", {
|
|
319
|
+
className: "flex items-center justify-between mb-5",
|
|
320
|
+
children: [
|
|
321
|
+
/* @__PURE__ */ w("button", {
|
|
322
|
+
type: "button",
|
|
323
|
+
onClick: () => I((e) => e - 1),
|
|
324
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent/80 transition-colors",
|
|
325
|
+
children: [/* @__PURE__ */ C(d, { className: "h-3.5 w-3.5" }), "Previous Week"]
|
|
326
|
+
}),
|
|
327
|
+
/* @__PURE__ */ w("h3", {
|
|
328
|
+
className: "text-sm font-medium text-foreground",
|
|
329
|
+
children: [
|
|
330
|
+
G.start,
|
|
331
|
+
" - ",
|
|
332
|
+
G.end
|
|
333
|
+
]
|
|
334
|
+
}),
|
|
335
|
+
/* @__PURE__ */ w("button", {
|
|
336
|
+
type: "button",
|
|
337
|
+
onClick: () => I((e) => e + 1),
|
|
338
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent/80 transition-colors",
|
|
339
|
+
children: ["Next Week", /* @__PURE__ */ C(f, { className: "h-3.5 w-3.5" })]
|
|
340
|
+
})
|
|
341
|
+
]
|
|
342
|
+
}), L.length === 0 ? /* @__PURE__ */ C(r, {
|
|
343
|
+
icon: /* @__PURE__ */ C(c, { className: "h-12 w-12" }),
|
|
344
|
+
title: "No shifts scheduled",
|
|
345
|
+
description: "No shifts scheduled for this week"
|
|
346
|
+
}) : /* @__PURE__ */ C("div", {
|
|
347
|
+
className: "space-y-3",
|
|
348
|
+
children: L.map((e) => /* @__PURE__ */ w("div", {
|
|
349
|
+
className: t("rounded-lg border p-4 transition-colors", e.status === "ongoing" ? "border-green-500/30 bg-green-500/5" : "border-border hover:bg-muted/30"),
|
|
350
|
+
children: [
|
|
351
|
+
/* @__PURE__ */ w("div", {
|
|
352
|
+
className: "flex items-center justify-between mb-3",
|
|
353
|
+
children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("div", {
|
|
354
|
+
className: "flex items-center gap-2 flex-wrap",
|
|
355
|
+
children: [/* @__PURE__ */ C("h4", {
|
|
356
|
+
className: "text-sm font-semibold text-foreground",
|
|
357
|
+
children: T(e.date)
|
|
358
|
+
}), /* @__PURE__ */ C("span", {
|
|
359
|
+
className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize", O(e.status)),
|
|
360
|
+
children: e.status === "ongoing" ? "Ongoing" : e.status
|
|
361
|
+
})]
|
|
362
|
+
}), /* @__PURE__ */ w("p", {
|
|
363
|
+
className: "text-xs text-muted-foreground mt-1",
|
|
364
|
+
children: [
|
|
365
|
+
E(e.startTime),
|
|
366
|
+
" - ",
|
|
367
|
+
E(e.endTime)
|
|
368
|
+
]
|
|
369
|
+
})] }), /* @__PURE__ */ w("div", {
|
|
370
|
+
className: "text-right",
|
|
371
|
+
children: [/* @__PURE__ */ C("p", {
|
|
372
|
+
className: "text-lg font-bold text-foreground",
|
|
373
|
+
children: i(e.earnings, { minimumFractionDigits: 0 })
|
|
374
|
+
}), e.rating != null && /* @__PURE__ */ w("p", {
|
|
375
|
+
className: "text-xs text-muted-foreground flex items-center gap-1 justify-end",
|
|
376
|
+
children: [/* @__PURE__ */ C(x, { className: "h-3 w-3 fill-yellow-400 text-yellow-400" }), e.rating]
|
|
377
|
+
})]
|
|
378
|
+
})]
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ w("div", {
|
|
381
|
+
className: "grid grid-cols-1 md:grid-cols-3 gap-3 text-sm",
|
|
382
|
+
children: [
|
|
383
|
+
/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
384
|
+
className: "text-xs text-muted-foreground",
|
|
385
|
+
children: "Cart"
|
|
386
|
+
}), /* @__PURE__ */ w("p", {
|
|
387
|
+
className: "text-xs font-medium text-foreground flex items-center gap-1",
|
|
388
|
+
children: [/* @__PURE__ */ C(b, { className: "h-3 w-3 text-muted-foreground" }), e.cartName]
|
|
389
|
+
})] }),
|
|
390
|
+
/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
391
|
+
className: "text-xs text-muted-foreground",
|
|
392
|
+
children: "Location"
|
|
393
|
+
}), /* @__PURE__ */ w("p", {
|
|
394
|
+
className: "text-xs font-medium text-foreground flex items-center gap-1",
|
|
395
|
+
children: [/* @__PURE__ */ C(g, { className: "h-3 w-3 text-muted-foreground" }), e.location]
|
|
396
|
+
})] }),
|
|
397
|
+
e.tasksCompleted != null && /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
398
|
+
className: "text-xs text-muted-foreground",
|
|
399
|
+
children: "Tasks Completed"
|
|
400
|
+
}), /* @__PURE__ */ w("p", {
|
|
401
|
+
className: "text-xs font-medium text-foreground flex items-center gap-1",
|
|
402
|
+
children: [/* @__PURE__ */ C(u, { className: "h-3 w-3 text-muted-foreground" }), e.tasksCompleted]
|
|
403
|
+
})] })
|
|
404
|
+
]
|
|
405
|
+
}),
|
|
406
|
+
e.status === "scheduled" && /* @__PURE__ */ C("div", {
|
|
407
|
+
className: "mt-3 pt-3 border-t border-border",
|
|
408
|
+
children: /* @__PURE__ */ w("button", {
|
|
409
|
+
type: "button",
|
|
410
|
+
onClick: () => K(e.id),
|
|
411
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-blue-500/10 px-3 py-1.5 text-xs font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-500/20 transition-colors",
|
|
412
|
+
children: [/* @__PURE__ */ C(m, { className: "h-3.5 w-3.5" }), "Check In"]
|
|
413
|
+
})
|
|
414
|
+
}),
|
|
415
|
+
e.status === "ongoing" && /* @__PURE__ */ w("div", {
|
|
416
|
+
className: "mt-3 pt-3 border-t border-green-500/20 flex items-center justify-between",
|
|
417
|
+
children: [/* @__PURE__ */ w("span", {
|
|
418
|
+
className: "text-xs font-medium text-green-600 dark:text-green-400 flex items-center gap-1",
|
|
419
|
+
children: [/* @__PURE__ */ C(_, { className: "h-3.5 w-3.5" }), "Shift in progress"]
|
|
420
|
+
}), /* @__PURE__ */ w("button", {
|
|
421
|
+
type: "button",
|
|
422
|
+
onClick: () => q(e.id),
|
|
423
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent/80 transition-colors",
|
|
424
|
+
children: [/* @__PURE__ */ C(h, { className: "h-3.5 w-3.5" }), "Check Out"]
|
|
425
|
+
})]
|
|
426
|
+
})
|
|
427
|
+
]
|
|
428
|
+
}, e.id))
|
|
429
|
+
})] }),
|
|
430
|
+
N === "requests" && /* @__PURE__ */ C("div", { children: z.length === 0 ? /* @__PURE__ */ C(r, {
|
|
431
|
+
icon: /* @__PURE__ */ C(y, { className: "h-12 w-12" }),
|
|
432
|
+
title: "No shift requests",
|
|
433
|
+
description: "No shift requests available"
|
|
434
|
+
}) : /* @__PURE__ */ C("div", {
|
|
435
|
+
className: "space-y-3",
|
|
436
|
+
children: z.map((e) => /* @__PURE__ */ w("div", {
|
|
437
|
+
className: "rounded-lg border border-border p-4",
|
|
438
|
+
children: [
|
|
439
|
+
/* @__PURE__ */ w("div", {
|
|
440
|
+
className: "flex items-center justify-between mb-3",
|
|
441
|
+
children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h4", {
|
|
442
|
+
className: "text-sm font-semibold text-foreground",
|
|
443
|
+
children: T(e.date)
|
|
444
|
+
}), /* @__PURE__ */ w("p", {
|
|
445
|
+
className: "text-xs text-muted-foreground mt-0.5",
|
|
446
|
+
children: [
|
|
447
|
+
E(e.startTime),
|
|
448
|
+
" - ",
|
|
449
|
+
E(e.endTime)
|
|
450
|
+
]
|
|
451
|
+
})] }), /* @__PURE__ */ C("span", {
|
|
452
|
+
className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize", k(e.status)),
|
|
453
|
+
children: e.status
|
|
454
|
+
})]
|
|
455
|
+
}),
|
|
456
|
+
/* @__PURE__ */ w("div", {
|
|
457
|
+
className: "grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3",
|
|
458
|
+
children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
459
|
+
className: "text-xs text-muted-foreground",
|
|
460
|
+
children: "Cart"
|
|
461
|
+
}), /* @__PURE__ */ C("p", {
|
|
462
|
+
className: "text-xs font-medium text-foreground",
|
|
463
|
+
children: e.cartName
|
|
464
|
+
})] }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
465
|
+
className: "text-xs text-muted-foreground",
|
|
466
|
+
children: "Location"
|
|
467
|
+
}), /* @__PURE__ */ C("p", {
|
|
468
|
+
className: "text-xs font-medium text-foreground",
|
|
469
|
+
children: e.location
|
|
470
|
+
})] })]
|
|
471
|
+
}),
|
|
472
|
+
/* @__PURE__ */ w("p", {
|
|
473
|
+
className: "text-[10px] text-muted-foreground mb-3",
|
|
474
|
+
children: [
|
|
475
|
+
"Requested",
|
|
476
|
+
" ",
|
|
477
|
+
new Date(e.requestedOn).toLocaleString("en-IN", {
|
|
478
|
+
day: "numeric",
|
|
479
|
+
month: "short",
|
|
480
|
+
hour: "2-digit",
|
|
481
|
+
minute: "2-digit",
|
|
482
|
+
hour12: !0
|
|
483
|
+
})
|
|
484
|
+
]
|
|
485
|
+
}),
|
|
486
|
+
e.status === "pending" && /* @__PURE__ */ w("div", {
|
|
487
|
+
className: "flex gap-2",
|
|
488
|
+
children: [/* @__PURE__ */ w("button", {
|
|
489
|
+
type: "button",
|
|
490
|
+
onClick: () => J(e.id),
|
|
491
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-green-500/10 px-3 py-1.5 text-xs font-medium text-green-600 dark:text-green-400 hover:bg-green-500/20 transition-colors",
|
|
492
|
+
children: [/* @__PURE__ */ C(u, { className: "h-3.5 w-3.5" }), "Accept"]
|
|
493
|
+
}), /* @__PURE__ */ C("button", {
|
|
494
|
+
type: "button",
|
|
495
|
+
onClick: () => Y(e.id),
|
|
496
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-red-500/10 px-3 py-1.5 text-xs font-medium text-red-600 dark:text-red-400 hover:bg-red-500/20 transition-colors",
|
|
497
|
+
children: "Reject"
|
|
498
|
+
})]
|
|
499
|
+
})
|
|
500
|
+
]
|
|
501
|
+
}, e.id))
|
|
502
|
+
}) }),
|
|
503
|
+
N === "availability" && /* @__PURE__ */ w("div", { children: [
|
|
504
|
+
/* @__PURE__ */ C("p", {
|
|
505
|
+
className: "text-xs text-muted-foreground mb-5",
|
|
506
|
+
children: "Set your preferred working hours for each day of the week"
|
|
507
|
+
}),
|
|
508
|
+
/* @__PURE__ */ C("div", {
|
|
509
|
+
className: "space-y-3",
|
|
510
|
+
children: V.map((e) => /* @__PURE__ */ w("div", {
|
|
511
|
+
className: t("flex flex-col sm:flex-row sm:items-center gap-3 p-3 rounded-lg border", e.isAvailable ? "border-border bg-card" : "border-border/50 bg-muted/30"),
|
|
512
|
+
children: [/* @__PURE__ */ C("div", {
|
|
513
|
+
className: "w-32 shrink-0",
|
|
514
|
+
children: /* @__PURE__ */ w("label", {
|
|
515
|
+
className: "flex items-center gap-2 cursor-pointer",
|
|
516
|
+
children: [/* @__PURE__ */ C("input", {
|
|
517
|
+
type: "checkbox",
|
|
518
|
+
checked: e.isAvailable,
|
|
519
|
+
onChange: (t) => X(e.dayOfWeek, "isAvailable", t.target.checked),
|
|
520
|
+
className: "h-4 w-4 rounded border-border text-blue-600 focus:ring-blue-500/40"
|
|
521
|
+
}), /* @__PURE__ */ C("span", {
|
|
522
|
+
className: "text-sm font-medium text-foreground",
|
|
523
|
+
children: e.dayOfWeek
|
|
524
|
+
})]
|
|
525
|
+
})
|
|
526
|
+
}), e.isAvailable ? /* @__PURE__ */ w("div", {
|
|
527
|
+
className: "flex flex-col sm:flex-row gap-3 flex-1",
|
|
528
|
+
children: [/* @__PURE__ */ w("div", {
|
|
529
|
+
className: "flex items-center gap-2",
|
|
530
|
+
children: [/* @__PURE__ */ C("span", {
|
|
531
|
+
className: "text-xs text-muted-foreground w-10",
|
|
532
|
+
children: "From"
|
|
533
|
+
}), /* @__PURE__ */ C("input", {
|
|
534
|
+
type: "time",
|
|
535
|
+
value: e.preferredStartTime,
|
|
536
|
+
onChange: (t) => X(e.dayOfWeek, "preferredStartTime", t.target.value),
|
|
537
|
+
className: "rounded-md border border-border bg-background px-3 py-1.5 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500/40"
|
|
538
|
+
})]
|
|
539
|
+
}), /* @__PURE__ */ w("div", {
|
|
540
|
+
className: "flex items-center gap-2",
|
|
541
|
+
children: [/* @__PURE__ */ C("span", {
|
|
542
|
+
className: "text-xs text-muted-foreground w-10",
|
|
543
|
+
children: "To"
|
|
544
|
+
}), /* @__PURE__ */ C("input", {
|
|
545
|
+
type: "time",
|
|
546
|
+
value: e.preferredEndTime,
|
|
547
|
+
onChange: (t) => X(e.dayOfWeek, "preferredEndTime", t.target.value),
|
|
548
|
+
className: "rounded-md border border-border bg-background px-3 py-1.5 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500/40"
|
|
549
|
+
})]
|
|
550
|
+
})]
|
|
551
|
+
}) : /* @__PURE__ */ C("span", {
|
|
552
|
+
className: "text-xs text-muted-foreground",
|
|
553
|
+
children: "Not available"
|
|
554
|
+
})]
|
|
555
|
+
}, e.dayOfWeek))
|
|
556
|
+
}),
|
|
557
|
+
/* @__PURE__ */ C("div", {
|
|
558
|
+
className: "mt-5",
|
|
559
|
+
children: /* @__PURE__ */ w("button", {
|
|
560
|
+
type: "button",
|
|
561
|
+
onClick: () => {
|
|
562
|
+
alert("Availability updated successfully");
|
|
563
|
+
},
|
|
564
|
+
className: "inline-flex items-center gap-2 rounded-md bg-blue-500/10 px-4 py-2 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-500/20 transition-colors",
|
|
565
|
+
children: [/* @__PURE__ */ C(v, { className: "h-4 w-4" }), "Save Availability"]
|
|
566
|
+
})
|
|
567
|
+
})
|
|
568
|
+
] })
|
|
569
|
+
]
|
|
570
|
+
})]
|
|
571
|
+
})]
|
|
572
|
+
})
|
|
573
|
+
});
|
|
574
|
+
};
|
|
575
|
+
//#endregion
|
|
576
|
+
export { A as WorkerSchedulePage };
|
|
577
|
+
|
|
578
|
+
//# sourceMappingURL=WorkerSchedulePage.js.map
|