@burdenoff/microfe-labsofscience 2026.626.2 → 2026.628.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/dist/index.js +4 -4
  2. package/dist/labsofscience/LabsOfScienceRoot.js +68 -124
  3. package/dist/labsofscience/LabsOfScienceRoot.js.map +1 -1
  4. package/dist/labsofscience/LabsOfScienceRoutes.js +61 -185
  5. package/dist/labsofscience/LabsOfScienceRoutes.js.map +1 -1
  6. package/dist/labsofscience/components/QueryStates.js +40 -0
  7. package/dist/labsofscience/components/QueryStates.js.map +1 -0
  8. package/dist/labsofscience/components/StatusBadge.js +40 -23
  9. package/dist/labsofscience/components/StatusBadge.js.map +1 -1
  10. package/dist/labsofscience/context/LabsOfScienceContext.js +22 -30
  11. package/dist/labsofscience/context/LabsOfScienceContext.js.map +1 -1
  12. package/dist/labsofscience/hooks/useLabsOfScienceApi.js +500 -172
  13. package/dist/labsofscience/hooks/useLabsOfScienceApi.js.map +1 -1
  14. package/dist/labsofscience/pages/OverviewPage.js +195 -0
  15. package/dist/labsofscience/pages/OverviewPage.js.map +1 -0
  16. package/dist/labsofscience/pages/datasets/DatasetDetailPage.js +162 -0
  17. package/dist/labsofscience/pages/datasets/DatasetDetailPage.js.map +1 -0
  18. package/dist/labsofscience/pages/datasets/DatasetFormDialog.js +137 -0
  19. package/dist/labsofscience/pages/datasets/DatasetFormDialog.js.map +1 -0
  20. package/dist/labsofscience/pages/datasets/DatasetsListPage.js +155 -0
  21. package/dist/labsofscience/pages/datasets/DatasetsListPage.js.map +1 -0
  22. package/dist/labsofscience/pages/experiments/ExperimentDetailPage.js +220 -0
  23. package/dist/labsofscience/pages/experiments/ExperimentDetailPage.js.map +1 -0
  24. package/dist/labsofscience/pages/experiments/ExperimentFormDialog.js +170 -0
  25. package/dist/labsofscience/pages/experiments/ExperimentFormDialog.js.map +1 -0
  26. package/dist/labsofscience/pages/experiments/ExperimentsListPage.js +134 -0
  27. package/dist/labsofscience/pages/experiments/ExperimentsListPage.js.map +1 -0
  28. package/dist/labsofscience/pages/experiments/RunDialogs.js +180 -0
  29. package/dist/labsofscience/pages/experiments/RunDialogs.js.map +1 -0
  30. package/dist/labsofscience/pages/instruments/InstrumentDetailPage.js +130 -0
  31. package/dist/labsofscience/pages/instruments/InstrumentDetailPage.js.map +1 -0
  32. package/dist/labsofscience/pages/instruments/InstrumentFormDialog.js +132 -0
  33. package/dist/labsofscience/pages/instruments/InstrumentFormDialog.js.map +1 -0
  34. package/dist/labsofscience/pages/instruments/InstrumentsListPage.js +126 -0
  35. package/dist/labsofscience/pages/instruments/InstrumentsListPage.js.map +1 -0
  36. package/dist/labsofscience/pages/inventory/AdjustInventoryDialog.js +89 -0
  37. package/dist/labsofscience/pages/inventory/AdjustInventoryDialog.js.map +1 -0
  38. package/dist/labsofscience/pages/inventory/InventoryDetailPage.js +138 -0
  39. package/dist/labsofscience/pages/inventory/InventoryDetailPage.js.map +1 -0
  40. package/dist/labsofscience/pages/inventory/InventoryFormDialog.js +211 -0
  41. package/dist/labsofscience/pages/inventory/InventoryFormDialog.js.map +1 -0
  42. package/dist/labsofscience/pages/inventory/InventoryListPage.js +178 -0
  43. package/dist/labsofscience/pages/inventory/InventoryListPage.js.map +1 -0
  44. package/dist/labsofscience/pages/notebook/NotebookEntryFormDialog.js +118 -0
  45. package/dist/labsofscience/pages/notebook/NotebookEntryFormDialog.js.map +1 -0
  46. package/dist/labsofscience/pages/notebook/NotebookListPage.js +144 -0
  47. package/dist/labsofscience/pages/notebook/NotebookListPage.js.map +1 -0
  48. package/dist/labsofscience/pages/pipelines/PipelineFormDialog.js +146 -0
  49. package/dist/labsofscience/pages/pipelines/PipelineFormDialog.js.map +1 -0
  50. package/dist/labsofscience/pages/pipelines/PipelinesPage.js +212 -0
  51. package/dist/labsofscience/pages/pipelines/PipelinesPage.js.map +1 -0
  52. package/dist/labsofscience/pages/pipelines/RunPipelineDialog.js +109 -0
  53. package/dist/labsofscience/pages/pipelines/RunPipelineDialog.js.map +1 -0
  54. package/dist/labsofscience/pages/projects/ProjectDetailPage.js +174 -0
  55. package/dist/labsofscience/pages/projects/ProjectDetailPage.js.map +1 -0
  56. package/dist/labsofscience/pages/projects/ProjectFormDialog.js +169 -0
  57. package/dist/labsofscience/pages/projects/ProjectFormDialog.js.map +1 -0
  58. package/dist/labsofscience/pages/projects/ProjectsListPage.js +141 -0
  59. package/dist/labsofscience/pages/projects/ProjectsListPage.js.map +1 -0
  60. package/dist/labsofscience/pages/protocols/ProtocolDetailPage.js +133 -0
  61. package/dist/labsofscience/pages/protocols/ProtocolDetailPage.js.map +1 -0
  62. package/dist/labsofscience/pages/protocols/ProtocolFormDialog.js +151 -0
  63. package/dist/labsofscience/pages/protocols/ProtocolFormDialog.js.map +1 -0
  64. package/dist/labsofscience/pages/protocols/ProtocolsListPage.js +140 -0
  65. package/dist/labsofscience/pages/protocols/ProtocolsListPage.js.map +1 -0
  66. package/dist/labsofscience/pages/shared/DetailComponents.js +64 -0
  67. package/dist/labsofscience/pages/shared/DetailComponents.js.map +1 -0
  68. package/dist/labsofscience/pages/shared/tags.js +16 -0
  69. package/dist/labsofscience/pages/shared/tags.js.map +1 -0
  70. package/dist/labsofscience/store/labsofscienceStore.js +6 -11
  71. package/dist/labsofscience/store/labsofscienceStore.js.map +1 -1
  72. package/dist/labsofscience/utils/formatters.js +28 -13
  73. package/dist/labsofscience/utils/formatters.js.map +1 -1
  74. package/package.json +1 -1
  75. package/dist/labsofscience/components/InvestmentCard.js +0 -98
  76. package/dist/labsofscience/components/InvestmentCard.js.map +0 -1
  77. package/dist/labsofscience/components/RatingDisplay.js +0 -35
  78. package/dist/labsofscience/components/RatingDisplay.js.map +0 -1
  79. package/dist/labsofscience/mocks/data.js +0 -1517
  80. package/dist/labsofscience/mocks/data.js.map +0 -1
  81. package/dist/labsofscience/mocks/users.js +0 -34
  82. package/dist/labsofscience/mocks/users.js.map +0 -1
  83. package/dist/labsofscience/pages/HomePage.js +0 -940
  84. package/dist/labsofscience/pages/HomePage.js.map +0 -1
  85. package/dist/labsofscience/pages/admin/AdminAnalyticsPage.js +0 -651
  86. package/dist/labsofscience/pages/admin/AdminAnalyticsPage.js.map +0 -1
  87. package/dist/labsofscience/pages/admin/AdminDashboard.js +0 -672
  88. package/dist/labsofscience/pages/admin/AdminDashboard.js.map +0 -1
  89. package/dist/labsofscience/pages/admin/AdminFinancialPage.js +0 -427
  90. package/dist/labsofscience/pages/admin/AdminFinancialPage.js.map +0 -1
  91. package/dist/labsofscience/pages/admin/AdminOrdersPage.js +0 -665
  92. package/dist/labsofscience/pages/admin/AdminOrdersPage.js.map +0 -1
  93. package/dist/labsofscience/pages/admin/AdminProfilePage.js +0 -261
  94. package/dist/labsofscience/pages/admin/AdminProfilePage.js.map +0 -1
  95. package/dist/labsofscience/pages/admin/AdminSettingsPage.js +0 -651
  96. package/dist/labsofscience/pages/admin/AdminSettingsPage.js.map +0 -1
  97. package/dist/labsofscience/pages/admin/CartManagementPage.js +0 -874
  98. package/dist/labsofscience/pages/admin/CartManagementPage.js.map +0 -1
  99. package/dist/labsofscience/pages/admin/UserManagementPage.js +0 -898
  100. package/dist/labsofscience/pages/admin/UserManagementPage.js.map +0 -1
  101. package/dist/labsofscience/pages/cart-owner/AnalyticsDashboard.js +0 -839
  102. package/dist/labsofscience/pages/cart-owner/AnalyticsDashboard.js.map +0 -1
  103. package/dist/labsofscience/pages/cart-owner/BusinessSettingsPage.js +0 -705
  104. package/dist/labsofscience/pages/cart-owner/BusinessSettingsPage.js.map +0 -1
  105. package/dist/labsofscience/pages/cart-owner/CartOwnerDashboard.js +0 -791
  106. package/dist/labsofscience/pages/cart-owner/CartOwnerDashboard.js.map +0 -1
  107. package/dist/labsofscience/pages/cart-owner/CartOwnerProfilePage.js +0 -891
  108. package/dist/labsofscience/pages/cart-owner/CartOwnerProfilePage.js.map +0 -1
  109. package/dist/labsofscience/pages/cart-owner/CartServiceConfigPage.js +0 -636
  110. package/dist/labsofscience/pages/cart-owner/CartServiceConfigPage.js.map +0 -1
  111. package/dist/labsofscience/pages/cart-owner/InventoryManagementPage.js +0 -911
  112. package/dist/labsofscience/pages/cart-owner/InventoryManagementPage.js.map +0 -1
  113. package/dist/labsofscience/pages/cart-owner/OrderManagementPage.js +0 -879
  114. package/dist/labsofscience/pages/cart-owner/OrderManagementPage.js.map +0 -1
  115. package/dist/labsofscience/pages/cart-owner/StaffManagementPage.js +0 -839
  116. package/dist/labsofscience/pages/cart-owner/StaffManagementPage.js.map +0 -1
  117. package/dist/labsofscience/pages/common/HelpSupportPage.js +0 -1324
  118. package/dist/labsofscience/pages/common/HelpSupportPage.js.map +0 -1
  119. package/dist/labsofscience/pages/common/NotificationCenterPage.js +0 -672
  120. package/dist/labsofscience/pages/common/NotificationCenterPage.js.map +0 -1
  121. package/dist/labsofscience/pages/common/SettingsPage.js +0 -973
  122. package/dist/labsofscience/pages/common/SettingsPage.js.map +0 -1
  123. package/dist/labsofscience/pages/customer/BookingDetailsPage.js +0 -637
  124. package/dist/labsofscience/pages/customer/BookingDetailsPage.js.map +0 -1
  125. package/dist/labsofscience/pages/customer/CartDetailPage.js +0 -653
  126. package/dist/labsofscience/pages/customer/CartDetailPage.js.map +0 -1
  127. package/dist/labsofscience/pages/customer/CartDiscoveryPage.js +0 -559
  128. package/dist/labsofscience/pages/customer/CartDiscoveryPage.js.map +0 -1
  129. package/dist/labsofscience/pages/customer/CheckoutPage.js +0 -530
  130. package/dist/labsofscience/pages/customer/CheckoutPage.js.map +0 -1
  131. package/dist/labsofscience/pages/customer/CustomerDashboard.js +0 -531
  132. package/dist/labsofscience/pages/customer/CustomerDashboard.js.map +0 -1
  133. package/dist/labsofscience/pages/customer/CustomerProfilePage.js +0 -658
  134. package/dist/labsofscience/pages/customer/CustomerProfilePage.js.map +0 -1
  135. package/dist/labsofscience/pages/customer/DirectServiceBookingPage.js +0 -633
  136. package/dist/labsofscience/pages/customer/DirectServiceBookingPage.js.map +0 -1
  137. package/dist/labsofscience/pages/customer/FavoritesPage.js +0 -484
  138. package/dist/labsofscience/pages/customer/FavoritesPage.js.map +0 -1
  139. package/dist/labsofscience/pages/customer/OrderHistoryPage.js +0 -445
  140. package/dist/labsofscience/pages/customer/OrderHistoryPage.js.map +0 -1
  141. package/dist/labsofscience/pages/customer/OrderTrackingPage.js +0 -425
  142. package/dist/labsofscience/pages/customer/OrderTrackingPage.js.map +0 -1
  143. package/dist/labsofscience/pages/customer/PaymentMethodsPage.js +0 -495
  144. package/dist/labsofscience/pages/customer/PaymentMethodsPage.js.map +0 -1
  145. package/dist/labsofscience/pages/customer/ReviewsPage.js +0 -613
  146. package/dist/labsofscience/pages/customer/ReviewsPage.js.map +0 -1
  147. package/dist/labsofscience/pages/customer/SavedAddressesPage.js +0 -450
  148. package/dist/labsofscience/pages/customer/SavedAddressesPage.js.map +0 -1
  149. package/dist/labsofscience/pages/investor/InvestmentDetailsPage.js +0 -881
  150. package/dist/labsofscience/pages/investor/InvestmentDetailsPage.js.map +0 -1
  151. package/dist/labsofscience/pages/investor/InvestmentOpportunitiesPage.js +0 -946
  152. package/dist/labsofscience/pages/investor/InvestmentOpportunitiesPage.js.map +0 -1
  153. package/dist/labsofscience/pages/investor/InvestorAnalyticsPage.js +0 -687
  154. package/dist/labsofscience/pages/investor/InvestorAnalyticsPage.js.map +0 -1
  155. package/dist/labsofscience/pages/investor/InvestorDashboard.js +0 -455
  156. package/dist/labsofscience/pages/investor/InvestorDashboard.js.map +0 -1
  157. package/dist/labsofscience/pages/investor/InvestorInvestmentsPage.js +0 -406
  158. package/dist/labsofscience/pages/investor/InvestorInvestmentsPage.js.map +0 -1
  159. package/dist/labsofscience/pages/investor/InvestorPortfolioPage.js +0 -575
  160. package/dist/labsofscience/pages/investor/InvestorPortfolioPage.js.map +0 -1
  161. package/dist/labsofscience/pages/investor/InvestorProfilePage.js +0 -1070
  162. package/dist/labsofscience/pages/investor/InvestorProfilePage.js.map +0 -1
  163. package/dist/labsofscience/pages/worker/TaskDetailsPage.js +0 -537
  164. package/dist/labsofscience/pages/worker/TaskDetailsPage.js.map +0 -1
  165. package/dist/labsofscience/pages/worker/WorkerDashboard.js +0 -665
  166. package/dist/labsofscience/pages/worker/WorkerDashboard.js.map +0 -1
  167. package/dist/labsofscience/pages/worker/WorkerOrdersPage.js +0 -681
  168. package/dist/labsofscience/pages/worker/WorkerOrdersPage.js.map +0 -1
  169. package/dist/labsofscience/pages/worker/WorkerProfilePage.js +0 -692
  170. package/dist/labsofscience/pages/worker/WorkerProfilePage.js.map +0 -1
  171. package/dist/labsofscience/pages/worker/WorkerSchedulePage.js +0 -588
  172. package/dist/labsofscience/pages/worker/WorkerSchedulePage.js.map +0 -1
@@ -1,665 +0,0 @@
1
- import { useLabsOfScience as e } from "../../context/LabsOfScienceContext.js";
2
- import { cn as t } from "../../utils/cn.js";
3
- import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { useUpdateWorkerTaskStatus as r, useWorkerClockInOut as i, useWorkerStats as a, useWorkerTasks as o } from "../../hooks/useLabsOfScienceApi.js";
5
- import { formatCurrency as s } from "../../utils/formatters.js";
6
- import { useState as c } from "react";
7
- import { Boxes as l, CalendarDays as u, CheckCircle2 as d, ChefHat as f, ChevronRight as p, ClipboardList as m, Clock as h, Loader2 as g, MapPin as _, Package as v, Pause as y, Play as b, Sparkles as x, Star as S, Timer as C, TrendingUp as w, Truck as T, User as E, Zap as D } from "lucide-react";
8
- import { jsx as O, jsxs as k } from "react/jsx-runtime";
9
- import { EmphasisPanel as A, NextSteps as j, PagePurpose as M } from "@burdenoff/fe-libs/ui";
10
- //#region src/labsofscience/pages/worker/WorkerDashboard.tsx
11
- var N = {
12
- high: "bg-status-error-bg-subtle text-status-error-text",
13
- medium: "bg-status-warning-bg-subtle text-status-warning-text",
14
- low: "bg-status-success-bg-subtle text-status-success-text"
15
- }, P = {
16
- pending: "bg-secondary text-secondary-foreground",
17
- in_progress: "bg-status-info-bg-subtle text-status-info-text",
18
- completed: "bg-status-success-bg-subtle text-status-success-text"
19
- };
20
- function F(e) {
21
- switch (e) {
22
- case "delivery": return T;
23
- case "preparation": return f;
24
- case "inventory": return l;
25
- case "cleanup": return x;
26
- default: return m;
27
- }
28
- }
29
- var I = {
30
- high: 3,
31
- medium: 2,
32
- low: 1
33
- }, L = () => {
34
- let { navigateTo: l, currentUser: f } = e(), m = f?.id || "", { data: T = [], isLoading: L } = o(m), { data: R, isLoading: z } = a(m), B = r(), V = i(), [H, U] = c(null), [W, G] = c(!1), [K, q] = c(null), J = async (e, t) => {
35
- let n = "";
36
- switch (t) {
37
- case "start":
38
- n = "IN_PROGRESS", U(e);
39
- break;
40
- case "complete":
41
- n = "COMPLETED", H === e && U(null);
42
- break;
43
- case "pause":
44
- n = "PENDING", H === e && U(null);
45
- break;
46
- }
47
- try {
48
- await B.mutateAsync({
49
- taskId: e,
50
- status: n
51
- });
52
- } catch (e) {
53
- console.error("Failed to update task status:", e), alert("Failed to update task status. Please try again.");
54
- }
55
- }, Y = async () => {
56
- let e = W ? "CLOCK_OUT" : "CLOCK_IN";
57
- try {
58
- let t = await V.mutateAsync({
59
- workerId: m,
60
- action: e
61
- });
62
- if (t.success) {
63
- if (W) G(!1), q(null);
64
- else {
65
- let e = (/* @__PURE__ */ new Date()).toLocaleTimeString("en-IN", {
66
- hour: "2-digit",
67
- minute: "2-digit",
68
- hour12: !0
69
- });
70
- G(!0), q(e);
71
- }
72
- alert(t.message || `${W ? "Clocked out" : "Clocked in"} successfully`);
73
- }
74
- } catch (e) {
75
- console.error("Failed to clock in/out:", e), alert("Action failed. Please try again.");
76
- }
77
- };
78
- if (L || z) return /* @__PURE__ */ O(n, {
79
- title: "Dashboard",
80
- description: "Your work overview for today",
81
- children: /* @__PURE__ */ O("div", {
82
- className: "flex items-center justify-center py-24",
83
- children: /* @__PURE__ */ k("div", {
84
- className: "text-center",
85
- children: [/* @__PURE__ */ O(g, { className: "h-10 w-10 animate-spin text-text-secondary mx-auto mb-4" }), /* @__PURE__ */ O("p", {
86
- className: "text-sm text-text-secondary",
87
- children: "Loading your dashboard..."
88
- })]
89
- })
90
- })
91
- });
92
- let X = H ? T.find((e) => e.id === H) : null, Z = T.filter((e) => e.status !== "completed").sort((e, t) => (I[t.priority] ?? 0) - (I[e.priority] ?? 0)), Q = T.filter((e) => e.status === "completed");
93
- return /* @__PURE__ */ O(n, {
94
- title: "Dashboard",
95
- description: "Manage your tasks and assignments",
96
- actions: /* @__PURE__ */ k("button", {
97
- type: "button",
98
- onClick: () => l("/worker/orders"),
99
- 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 transition-colors",
100
- children: ["View All Orders", /* @__PURE__ */ O(p, { className: "h-4 w-4" })]
101
- }),
102
- children: /* @__PURE__ */ k("div", {
103
- className: "space-y-6",
104
- children: [
105
- /* @__PURE__ */ O(M, {
106
- icon: /* @__PURE__ */ O(x, { className: "h-4 w-4" }),
107
- children: "Your shift cockpit. Clock in, see today's completed, in-progress and pending tasks with your hours and rating, then pick up your next delivery or service job — this is where you run your working day."
108
- }),
109
- /* @__PURE__ */ O(j, {
110
- storageKey: "labsofscience-worker-dashboard",
111
- steps: [
112
- {
113
- id: "clock",
114
- label: W ? "Clock out when your shift ends" : "Clock in to start your shift",
115
- description: "Your hours and availability are tracked from here.",
116
- icon: /* @__PURE__ */ O(C, { className: "h-4 w-4" }),
117
- onClick: Y
118
- },
119
- {
120
- id: "orders",
121
- label: "Pick up your assigned orders",
122
- description: "View and accept the jobs waiting for you.",
123
- icon: /* @__PURE__ */ O(v, { className: "h-4 w-4" }),
124
- onClick: () => l("/worker/orders")
125
- },
126
- {
127
- id: "schedule",
128
- label: "Check your schedule",
129
- description: "Plan around upcoming shifts and bookings.",
130
- icon: /* @__PURE__ */ O(u, { className: "h-4 w-4" }),
131
- onClick: () => l("/worker/schedule")
132
- }
133
- ]
134
- }),
135
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
136
- className: "text-base font-semibold text-text-primary mb-3",
137
- children: "Quick Actions"
138
- }), /* @__PURE__ */ k("div", {
139
- className: "grid grid-cols-2 lg:grid-cols-4 gap-3",
140
- children: [
141
- /* @__PURE__ */ k("button", {
142
- type: "button",
143
- onClick: () => l("/worker/orders"),
144
- className: "flex items-center justify-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
145
- children: [/* @__PURE__ */ O(v, { className: "h-4 w-4" }), "My Orders"]
146
- }),
147
- /* @__PURE__ */ k("button", {
148
- type: "button",
149
- onClick: () => l("/worker/schedule"),
150
- className: "flex items-center justify-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
151
- children: [/* @__PURE__ */ O(u, { className: "h-4 w-4" }), "Schedule"]
152
- }),
153
- /* @__PURE__ */ k("button", {
154
- type: "button",
155
- onClick: () => l("/worker/profile"),
156
- className: "flex items-center justify-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
157
- children: [/* @__PURE__ */ O(E, { className: "h-4 w-4" }), "Profile"]
158
- }),
159
- /* @__PURE__ */ k("button", {
160
- type: "button",
161
- onClick: Y,
162
- className: t("flex items-center justify-center gap-2 rounded-lg px-4 py-3 text-sm font-medium transition-colors", W ? "bg-status-error-bg-subtle text-status-error-text border border-status-error-border hover:bg-status-error-bg-subtle" : "bg-status-success-bg-subtle text-status-success-text border border-status-success-border hover:bg-status-success-bg-subtle"),
163
- children: [/* @__PURE__ */ O(C, { className: "h-4 w-4" }), W ? "Clock Out" : "Clock In"]
164
- })
165
- ]
166
- })] }),
167
- R && /* @__PURE__ */ k(A, { children: [/* @__PURE__ */ k("div", {
168
- className: "flex items-center justify-between mb-3",
169
- children: [/* @__PURE__ */ O("h2", {
170
- className: "text-base font-semibold text-text-primary",
171
- children: "Today's Overview"
172
- }), W && K && /* @__PURE__ */ k("div", {
173
- className: "flex items-center gap-2 rounded-lg bg-status-success-bg-subtle border border-status-success-border px-3 py-1.5",
174
- children: [/* @__PURE__ */ k("span", {
175
- className: "relative flex h-2 w-2",
176
- children: [/* @__PURE__ */ O("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-status-success-bg opacity-75" }), /* @__PURE__ */ O("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-status-success-bg" })]
177
- }), /* @__PURE__ */ k("span", {
178
- className: "text-xs font-medium text-status-success-text",
179
- children: ["Working since ", K]
180
- })]
181
- })]
182
- }), /* @__PURE__ */ k("div", {
183
- className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",
184
- children: [
185
- /* @__PURE__ */ k("div", {
186
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
187
- children: [
188
- /* @__PURE__ */ O("div", {
189
- className: "flex items-center gap-2 mb-2",
190
- children: /* @__PURE__ */ O("div", {
191
- className: "inline-flex rounded-md p-1.5 bg-status-success-bg-subtle text-status-success-text",
192
- children: /* @__PURE__ */ O(d, { className: "h-4 w-4" })
193
- })
194
- }),
195
- /* @__PURE__ */ O("p", {
196
- className: "text-2xl font-bold text-status-success-text",
197
- children: R.tasksCompleted
198
- }),
199
- /* @__PURE__ */ O("p", {
200
- className: "text-xs text-text-secondary",
201
- children: "Completed"
202
- })
203
- ]
204
- }),
205
- /* @__PURE__ */ k("div", {
206
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
207
- children: [
208
- /* @__PURE__ */ O("div", {
209
- className: "flex items-center gap-2 mb-2",
210
- children: /* @__PURE__ */ O("div", {
211
- className: "inline-flex rounded-md p-1.5 bg-status-info-bg-subtle text-status-info-text",
212
- children: /* @__PURE__ */ O(b, { className: "h-4 w-4" })
213
- })
214
- }),
215
- /* @__PURE__ */ O("p", {
216
- className: "text-2xl font-bold text-status-info-text",
217
- children: R.tasksInProgress
218
- }),
219
- /* @__PURE__ */ O("p", {
220
- className: "text-xs text-text-secondary",
221
- children: "In Progress"
222
- })
223
- ]
224
- }),
225
- /* @__PURE__ */ k("div", {
226
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
227
- children: [
228
- /* @__PURE__ */ O("div", {
229
- className: "flex items-center gap-2 mb-2",
230
- children: /* @__PURE__ */ O("div", {
231
- className: "inline-flex rounded-md p-1.5 bg-status-warning-bg-subtle text-status-warning-text",
232
- children: /* @__PURE__ */ O(h, { className: "h-4 w-4" })
233
- })
234
- }),
235
- /* @__PURE__ */ O("p", {
236
- className: "text-2xl font-bold text-status-warning-text",
237
- children: R.tasksPending
238
- }),
239
- /* @__PURE__ */ O("p", {
240
- className: "text-xs text-text-secondary",
241
- children: "Pending"
242
- })
243
- ]
244
- }),
245
- /* @__PURE__ */ k("div", {
246
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
247
- children: [
248
- /* @__PURE__ */ O("div", {
249
- className: "flex items-center gap-2 mb-2",
250
- children: /* @__PURE__ */ O("div", {
251
- className: "inline-flex rounded-md p-1.5 bg-[color-mix(in_oklab,var(--color-accent-purple)_14%,transparent)] text-accent-purple",
252
- children: /* @__PURE__ */ O(C, { className: "h-4 w-4" })
253
- })
254
- }),
255
- /* @__PURE__ */ k("p", {
256
- className: "text-2xl font-bold text-accent-purple",
257
- children: [R.hoursWorked, "h"]
258
- }),
259
- /* @__PURE__ */ O("p", {
260
- className: "text-xs text-text-secondary",
261
- children: "Hours Worked"
262
- })
263
- ]
264
- }),
265
- /* @__PURE__ */ k("div", {
266
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
267
- children: [
268
- /* @__PURE__ */ O("div", {
269
- className: "flex items-center gap-2 mb-2",
270
- children: /* @__PURE__ */ O("div", {
271
- className: "inline-flex rounded-md p-1.5 bg-status-info-bg-subtle text-status-info-text",
272
- children: /* @__PURE__ */ O(D, { className: "h-4 w-4" })
273
- })
274
- }),
275
- /* @__PURE__ */ k("p", {
276
- className: "text-2xl font-bold text-status-info-text",
277
- children: [R.efficiency, "%"]
278
- }),
279
- /* @__PURE__ */ O("p", {
280
- className: "text-xs text-text-secondary",
281
- children: "Efficiency"
282
- })
283
- ]
284
- }),
285
- /* @__PURE__ */ k("div", {
286
- className: "rounded-lg border border-border-seam bg-bg-surface p-4 shadow-sm",
287
- children: [
288
- /* @__PURE__ */ O("div", {
289
- className: "flex items-center gap-2 mb-2",
290
- children: /* @__PURE__ */ O("div", {
291
- className: "inline-flex rounded-md p-1.5 bg-status-warning-bg-subtle text-status-warning-text",
292
- children: /* @__PURE__ */ O(S, { className: "h-4 w-4" })
293
- })
294
- }),
295
- /* @__PURE__ */ k("p", {
296
- className: "text-2xl font-bold text-status-warning-text",
297
- children: [R.rating, "/5"]
298
- }),
299
- /* @__PURE__ */ O("p", {
300
- className: "text-xs text-text-secondary",
301
- children: "Rating"
302
- })
303
- ]
304
- })
305
- ]
306
- })] }),
307
- X && /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
308
- className: "text-base font-semibold text-text-primary mb-3",
309
- children: "Current Task"
310
- }), /* @__PURE__ */ O("div", {
311
- className: "rounded-lg border-2 border-status-info-border bg-status-info-bg-subtle p-6",
312
- children: /* @__PURE__ */ k("div", {
313
- className: "flex items-start justify-between mb-4",
314
- children: [/* @__PURE__ */ k("div", {
315
- className: "flex items-start gap-3",
316
- children: [/* @__PURE__ */ O("div", {
317
- className: "flex h-10 w-10 items-center justify-center rounded-lg bg-status-info-bg-subtle",
318
- children: /* @__PURE__ */ O(F(X.type), { className: "h-5 w-5 text-status-info-text" })
319
- }), /* @__PURE__ */ k("div", { children: [
320
- /* @__PURE__ */ O("h3", {
321
- className: "text-lg font-semibold text-text-primary",
322
- children: X.title
323
- }),
324
- /* @__PURE__ */ O("p", {
325
- className: "text-sm text-text-secondary mt-1",
326
- children: X.description
327
- }),
328
- /* @__PURE__ */ k("div", {
329
- className: "flex flex-wrap items-center gap-3 mt-2 text-sm text-text-secondary",
330
- children: [
331
- /* @__PURE__ */ k("span", {
332
- className: "flex items-center gap-1",
333
- children: [
334
- /* @__PURE__ */ O(h, { className: "h-3.5 w-3.5" }),
335
- X.estimatedTime,
336
- " min"
337
- ]
338
- }),
339
- X.dueTime && /* @__PURE__ */ k("span", {
340
- className: "flex items-center gap-1",
341
- children: [
342
- /* @__PURE__ */ O(C, { className: "h-3.5 w-3.5" }),
343
- "Due: ",
344
- X.dueTime
345
- ]
346
- }),
347
- X.location && /* @__PURE__ */ k("span", {
348
- className: "flex items-center gap-1",
349
- children: [/* @__PURE__ */ O(_, { className: "h-3.5 w-3.5" }), X.location]
350
- })
351
- ]
352
- })
353
- ] })]
354
- }), /* @__PURE__ */ k("div", {
355
- className: "flex gap-2 shrink-0",
356
- children: [/* @__PURE__ */ k("button", {
357
- type: "button",
358
- onClick: () => J(X.id, "complete"),
359
- className: "inline-flex items-center gap-1.5 rounded-md bg-status-success-bg-subtle px-3 py-2 text-sm font-medium text-status-success-text hover:bg-status-success-bg-subtle transition-colors",
360
- children: [/* @__PURE__ */ O(d, { className: "h-4 w-4" }), "Complete"]
361
- }), /* @__PURE__ */ k("button", {
362
- type: "button",
363
- onClick: () => J(X.id, "pause"),
364
- className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent/80 transition-colors",
365
- children: [/* @__PURE__ */ O(y, { className: "h-4 w-4" }), "Pause"]
366
- })]
367
- })]
368
- })
369
- })] }),
370
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
371
- className: "text-base font-semibold text-text-primary mb-3",
372
- children: "Assigned Tasks"
373
- }), /* @__PURE__ */ O("div", {
374
- className: "rounded-lg border border-border-seam bg-bg-surface shadow-sm overflow-hidden",
375
- children: Z.length > 0 ? /* @__PURE__ */ O("div", {
376
- className: "divide-y divide-border",
377
- children: Z.map((e) => /* @__PURE__ */ O("div", {
378
- className: "p-4 hover:bg-bg-sunken/30 transition-colors",
379
- children: /* @__PURE__ */ k("div", {
380
- className: "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3",
381
- children: [/* @__PURE__ */ k("div", {
382
- className: "flex items-start gap-3 flex-1 min-w-0",
383
- children: [/* @__PURE__ */ O("div", {
384
- className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken",
385
- children: /* @__PURE__ */ O(F(e.type), { className: "h-4.5 w-4.5 text-text-secondary" })
386
- }), /* @__PURE__ */ k("div", {
387
- className: "flex-1 min-w-0",
388
- children: [
389
- /* @__PURE__ */ k("div", {
390
- className: "flex flex-wrap items-center gap-2 mb-1",
391
- children: [
392
- /* @__PURE__ */ O("h3", {
393
- className: "text-sm font-medium text-text-primary",
394
- children: e.title
395
- }),
396
- /* @__PURE__ */ O("span", {
397
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize", N[e.priority]),
398
- children: e.priority
399
- }),
400
- /* @__PURE__ */ O("span", {
401
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium", P[e.status]),
402
- children: e.status.replace("_", " ")
403
- })
404
- ]
405
- }),
406
- /* @__PURE__ */ O("p", {
407
- className: "text-xs text-text-secondary line-clamp-1",
408
- children: e.description
409
- }),
410
- /* @__PURE__ */ k("div", {
411
- className: "flex flex-wrap items-center gap-3 mt-1.5 text-xs text-text-secondary",
412
- children: [
413
- /* @__PURE__ */ k("span", {
414
- className: "flex items-center gap-1",
415
- children: [/* @__PURE__ */ O(E, { className: "h-3 w-3" }), e.assignedBy]
416
- }),
417
- /* @__PURE__ */ k("span", {
418
- className: "flex items-center gap-1",
419
- children: [
420
- /* @__PURE__ */ O(h, { className: "h-3 w-3" }),
421
- e.estimatedTime,
422
- " min"
423
- ]
424
- }),
425
- e.dueTime && /* @__PURE__ */ k("span", {
426
- className: "flex items-center gap-1",
427
- children: [
428
- /* @__PURE__ */ O(C, { className: "h-3 w-3" }),
429
- "Due: ",
430
- e.dueTime
431
- ]
432
- }),
433
- e.location && /* @__PURE__ */ k("span", {
434
- className: "flex items-center gap-1",
435
- children: [/* @__PURE__ */ O(_, { className: "h-3 w-3" }), e.location]
436
- })
437
- ]
438
- })
439
- ]
440
- })]
441
- }), /* @__PURE__ */ k("div", {
442
- className: "flex gap-2 shrink-0",
443
- children: [
444
- e.status === "pending" && /* @__PURE__ */ k("button", {
445
- type: "button",
446
- onClick: () => J(e.id, "start"),
447
- disabled: H !== null,
448
- className: t("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", H === null ? "bg-status-info-bg-subtle text-status-info-text hover:bg-status-info-bg-subtle" : "bg-bg-sunken text-text-secondary cursor-not-allowed"),
449
- children: [/* @__PURE__ */ O(b, { className: "h-3.5 w-3.5" }), "Start"]
450
- }),
451
- e.status === "in_progress" && e.id !== H && /* @__PURE__ */ k("button", {
452
- type: "button",
453
- onClick: () => U(e.id),
454
- className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent/80 transition-colors",
455
- children: [/* @__PURE__ */ O(b, { className: "h-3.5 w-3.5" }), "Resume"]
456
- }),
457
- /* @__PURE__ */ k("button", {
458
- type: "button",
459
- onClick: () => l(`/worker/task/${e.id}`),
460
- className: "inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent/80 transition-colors",
461
- children: ["Details", /* @__PURE__ */ O(p, { className: "h-3.5 w-3.5" })]
462
- })
463
- ]
464
- })]
465
- })
466
- }, e.id))
467
- }) : /* @__PURE__ */ k("div", {
468
- className: "p-8 text-center",
469
- children: [/* @__PURE__ */ O(d, { className: "h-10 w-10 text-status-success-text opacity-40 mx-auto mb-2" }), /* @__PURE__ */ O("p", {
470
- className: "text-sm text-text-secondary",
471
- children: "All tasks completed!"
472
- })]
473
- })
474
- })] }),
475
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
476
- className: "text-base font-semibold text-text-primary mb-3",
477
- children: "Recently Completed"
478
- }), /* @__PURE__ */ O("div", {
479
- className: "rounded-lg border border-border-seam bg-bg-surface p-5 shadow-sm",
480
- children: Q.length > 0 ? /* @__PURE__ */ O("div", {
481
- className: "space-y-3",
482
- children: Q.slice(0, 3).map((e) => /* @__PURE__ */ k("div", {
483
- className: "flex items-center gap-3 p-3 rounded-lg bg-status-success-bg-subtle border border-status-success-border",
484
- children: [
485
- /* @__PURE__ */ O("div", {
486
- className: "flex h-8 w-8 items-center justify-center rounded-md bg-status-success-bg-subtle",
487
- children: /* @__PURE__ */ O(F(e.type), { className: "h-4 w-4 text-status-success-text" })
488
- }),
489
- /* @__PURE__ */ k("div", {
490
- className: "flex-1 min-w-0",
491
- children: [/* @__PURE__ */ O("p", {
492
- className: "text-sm font-medium text-text-primary",
493
- children: e.title
494
- }), /* @__PURE__ */ k("p", {
495
- className: "text-xs text-text-secondary",
496
- children: [
497
- "Completed at",
498
- " ",
499
- (/* @__PURE__ */ new Date()).toLocaleTimeString("en-IN", {
500
- hour: "2-digit",
501
- minute: "2-digit",
502
- hour12: !0
503
- })
504
- ]
505
- })]
506
- }),
507
- /* @__PURE__ */ O(d, { className: "h-4 w-4 text-status-success-text shrink-0" })
508
- ]
509
- }, e.id))
510
- }) : /* @__PURE__ */ O("p", {
511
- className: "text-sm text-text-secondary text-center py-4",
512
- children: "No completed tasks yet today"
513
- })
514
- })] }),
515
- /* @__PURE__ */ k("div", {
516
- className: "grid grid-cols-1 md:grid-cols-2 gap-6",
517
- children: [/* @__PURE__ */ k("div", {
518
- className: "rounded-lg border border-border-seam bg-bg-surface p-5 shadow-sm",
519
- children: [/* @__PURE__ */ k("h3", {
520
- className: "text-base font-semibold text-text-primary flex items-center gap-2 mb-4",
521
- children: [/* @__PURE__ */ O(w, { className: "h-4 w-4 text-text-secondary" }), "Performance This Week"]
522
- }), /* @__PURE__ */ k("div", {
523
- className: "space-y-3",
524
- children: [
525
- /* @__PURE__ */ k("div", {
526
- className: "flex items-center justify-between",
527
- children: [/* @__PURE__ */ O("span", {
528
- className: "text-sm text-text-secondary",
529
- children: "Tasks Completed"
530
- }), /* @__PURE__ */ O("span", {
531
- className: "text-sm font-medium text-text-primary",
532
- children: "47"
533
- })]
534
- }),
535
- /* @__PURE__ */ k("div", {
536
- className: "flex items-center justify-between",
537
- children: [/* @__PURE__ */ O("span", {
538
- className: "text-sm text-text-secondary",
539
- children: "Average Time per Task"
540
- }), /* @__PURE__ */ O("span", {
541
- className: "text-sm font-medium text-text-primary",
542
- children: "23 min"
543
- })]
544
- }),
545
- /* @__PURE__ */ k("div", {
546
- className: "flex items-center justify-between",
547
- children: [/* @__PURE__ */ O("span", {
548
- className: "text-sm text-text-secondary",
549
- children: "On-time Completion"
550
- }), /* @__PURE__ */ O("span", {
551
- className: "text-sm font-medium text-text-primary",
552
- children: "94%"
553
- })]
554
- }),
555
- /* @__PURE__ */ k("div", {
556
- className: "flex items-center justify-between",
557
- children: [/* @__PURE__ */ O("span", {
558
- className: "text-sm text-text-secondary",
559
- children: "Customer Feedback"
560
- }), /* @__PURE__ */ k("span", {
561
- className: "text-sm font-medium text-text-primary flex items-center gap-1",
562
- children: ["4.7/5", /* @__PURE__ */ O(S, { className: "h-3.5 w-3.5 fill-status-warning-text text-status-warning-text" })]
563
- })]
564
- })
565
- ]
566
- })]
567
- }), /* @__PURE__ */ k("div", {
568
- className: "rounded-lg border border-border-seam bg-bg-surface p-5 shadow-sm",
569
- children: [/* @__PURE__ */ k("h3", {
570
- className: "text-base font-semibold text-text-primary flex items-center gap-2 mb-4",
571
- children: [/* @__PURE__ */ O(u, { className: "h-4 w-4 text-text-secondary" }), "Shift Information"]
572
- }), /* @__PURE__ */ k("div", {
573
- className: "space-y-3",
574
- children: [
575
- /* @__PURE__ */ k("div", {
576
- className: "flex items-center justify-between",
577
- children: [/* @__PURE__ */ O("span", {
578
- className: "text-sm text-text-secondary",
579
- children: "Shift Start"
580
- }), /* @__PURE__ */ O("span", {
581
- className: "text-sm font-medium text-text-primary",
582
- children: "9:00 AM"
583
- })]
584
- }),
585
- /* @__PURE__ */ k("div", {
586
- className: "flex items-center justify-between",
587
- children: [/* @__PURE__ */ O("span", {
588
- className: "text-sm text-text-secondary",
589
- children: "Shift End"
590
- }), /* @__PURE__ */ O("span", {
591
- className: "text-sm font-medium text-text-primary",
592
- children: "6:00 PM"
593
- })]
594
- }),
595
- /* @__PURE__ */ k("div", {
596
- className: "flex items-center justify-between",
597
- children: [/* @__PURE__ */ O("span", {
598
- className: "text-sm text-text-secondary",
599
- children: "Break Time"
600
- }), /* @__PURE__ */ O("span", {
601
- className: "text-sm font-medium text-text-primary",
602
- children: "1:00 PM - 2:00 PM"
603
- })]
604
- }),
605
- /* @__PURE__ */ k("div", {
606
- className: "flex items-center justify-between",
607
- children: [/* @__PURE__ */ O("span", {
608
- className: "text-sm text-text-secondary",
609
- children: "Supervisor"
610
- }), /* @__PURE__ */ O("span", {
611
- className: "text-sm font-medium text-text-primary",
612
- children: "Rajesh Kumar"
613
- })]
614
- })
615
- ]
616
- })]
617
- })]
618
- }),
619
- /* @__PURE__ */ k("div", {
620
- className: "rounded-lg border border-border-seam bg-bg-surface p-5 shadow-sm",
621
- children: [/* @__PURE__ */ O("h2", {
622
- className: "text-base font-semibold text-text-primary mb-4",
623
- children: "Overall Performance"
624
- }), /* @__PURE__ */ k("div", {
625
- className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
626
- children: [
627
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
628
- className: "text-xs text-text-secondary",
629
- children: "Total Deliveries"
630
- }), /* @__PURE__ */ O("p", {
631
- className: "text-lg font-bold text-text-primary",
632
- children: R?.totalDeliveries || 0
633
- })] }),
634
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
635
- className: "text-xs text-text-secondary",
636
- children: "Total Earnings"
637
- }), /* @__PURE__ */ O("p", {
638
- className: "text-lg font-bold text-text-primary",
639
- children: s(R?.totalEarnings || 0, { minimumFractionDigits: 0 })
640
- })] }),
641
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
642
- className: "text-xs text-text-secondary",
643
- children: "Average Rating"
644
- }), /* @__PURE__ */ k("p", {
645
- className: "text-lg font-bold text-text-primary flex items-center gap-1",
646
- children: [R?.averageRating || 0, /* @__PURE__ */ O(S, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" })]
647
- })] }),
648
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
649
- className: "text-xs text-text-secondary",
650
- children: "Completion Rate"
651
- }), /* @__PURE__ */ k("p", {
652
- className: "text-lg font-bold text-text-primary",
653
- children: [R?.completionRate || 0, "%"]
654
- })] })
655
- ]
656
- })]
657
- })
658
- ]
659
- })
660
- });
661
- };
662
- //#endregion
663
- export { L as WorkerDashboard };
664
-
665
- //# sourceMappingURL=WorkerDashboard.js.map