flowcore-fn 2.9.9 → 3.1.0

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.
@@ -18,53 +18,218 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
 
21
- // src/components/WorkflowStep/main.js
22
- import React3, { useState } from "react";
21
+ // src/pages/WorkflowPage.js
22
+ import React5, { useState as useState2 } from "react";
23
23
 
24
- // src/components/WorkflowStep/footer.js
24
+ // src/components/Workflow/SearchBar.jsx
25
25
  import React from "react";
26
26
  import { jsx, jsxs } from "react/jsx-runtime";
27
- function Footer() {
28
- return /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center px-6 py-4 border-t border-gray-200 bg-white", children: [
29
- /* @__PURE__ */ jsx("div", { className: "text-sm text-slate-500", children: "Showing 1 to 5 of 5 entries" }),
30
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
31
- /* @__PURE__ */ jsx("button", { className: "px-3 py-1.5 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "First" }),
32
- /* @__PURE__ */ jsx("button", { className: "px-3 py-1.5 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "\u2039 Prev" }),
33
- /* @__PURE__ */ jsx("button", { className: "w-9 h-9 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "1" }),
34
- /* @__PURE__ */ jsx("button", { className: "w-9 h-9 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "2" }),
35
- /* @__PURE__ */ jsx("button", { className: "w-9 h-9 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "3" }),
36
- /* @__PURE__ */ jsx("button", { className: "w-9 h-9 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "4" }),
37
- /* @__PURE__ */ jsx("button", { className: "px-3 py-1.5 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "Next \u203A" }),
38
- /* @__PURE__ */ jsx("button", { className: "px-3 py-1.5 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "Last" })
39
- ] })
27
+ function SearchBar() {
28
+ return /* @__PURE__ */ jsxs("div", { className: "relative max-w-sm w-full", children: [
29
+ /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3.5 pointer-events-none", children: /* @__PURE__ */ jsx("svg", { className: "w-4.5 h-4.5 text-slate-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) }),
30
+ /* @__PURE__ */ jsx(
31
+ "input",
32
+ {
33
+ type: "text",
34
+ placeholder: "Search workflow name or code...",
35
+ className: "w-full pl-10 pr-4 py-2.5 border border-slate-200 rounded-xl text-sm bg-slate-50/50 focus:outline-none focus:ring-4 focus:ring-blue-500/10 focus:border-blue-500 text-slate-700 placeholder-slate-400 transition-all shadow-sm"
36
+ }
37
+ )
40
38
  ] });
41
39
  }
42
40
 
43
- // src/components/WorkflowStep/main.js
44
- import Link from "next/link";
45
-
46
- // src/components/WorkflowStep/AddWorkflowStepModal.js
47
- import React2 from "react";
41
+ // src/components/Workflow/WorkflowTable.jsx
42
+ import React2, { useState } from "react";
48
43
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
49
- function AddWorkflowStepModal({ onClose }) {
50
- return /* @__PURE__ */ jsxs2("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
51
- /* @__PURE__ */ jsx2(
44
+ function WorkflowTable({ pageSize }) {
45
+ const initialData = [
46
+ { id: "1", name: "Citizen Petition Workflow", code: "PET-001", type: "Petition", version: "1", published: true, status: true },
47
+ { id: "2", name: "Building Permission Workflow", code: "BLD-001", type: "Building Permission", version: "1", published: true, status: true },
48
+ { id: "3", name: "Leave Application Workflow", code: "LEV-001", type: "Leave", version: "1", published: false, status: true },
49
+ { id: "4", name: "Grievance Redressal Workflow", code: "GRV-001", type: "Grievance", version: "2", published: true, status: true },
50
+ { id: "5", name: "Trade License Workflow", code: "TRD-001", type: "Trade License", version: "1", published: true, status: true },
51
+ { id: "6", name: "Document Verification", code: "DOC-001", type: "Verification", version: "1", published: true, status: true },
52
+ { id: "7", name: "Citizen Petition Workflow", code: "PET-001", type: "Petition", version: "1", published: true, status: true },
53
+ { id: "8", name: "Building Permission Workflow", code: "BLD-001", type: "Building Permission", version: "1", published: true, status: true },
54
+ { id: "9", name: "Leave Application Workflow", code: "LEV-001", type: "Leave", version: "1", published: false, status: true },
55
+ { id: "10", name: "Grievance Redressal Workflow", code: "GRV-001", type: "Grievance", version: "2", published: true, status: true },
56
+ { id: "11", name: "Trade License Workflow", code: "TRD-001", type: "Trade License", version: "1", published: true, status: true },
57
+ { id: "12", name: "Document Verification", code: "DOC-001", type: "Verification", version: "1", published: true, status: true }
58
+ ];
59
+ const [data, setData] = useState(initialData);
60
+ const [sortColumn, setSortColumn] = useState("");
61
+ const [sortDirection, setSortDirection] = useState("asc");
62
+ const [currentPage, setCurrentPage] = useState(1);
63
+ const totalPages = Math.ceil(data.length / pageSize) || 1;
64
+ const startIndex = (currentPage - 1) * pageSize;
65
+ const visibleData = data.slice(startIndex, startIndex + pageSize);
66
+ const handleSort = (column) => {
67
+ const direction = sortColumn === column && sortDirection === "asc" ? "desc" : "asc";
68
+ setSortColumn(column);
69
+ setSortDirection(direction);
70
+ const sorted = [...data].sort((a, b) => {
71
+ const valueA = a[column];
72
+ const valueB = b[column];
73
+ if (typeof valueA === "string") {
74
+ return direction === "asc" ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
75
+ }
76
+ if (typeof valueA === "boolean") {
77
+ return direction === "asc" ? Number(valueA) - Number(valueB) : Number(valueB) - Number(valueA);
78
+ }
79
+ return direction === "asc" ? valueA - valueB : valueB - valueA;
80
+ });
81
+ setData(sorted);
82
+ };
83
+ const getSortIcon = (column) => {
84
+ if (sortColumn !== column) {
85
+ return /* @__PURE__ */ jsx2("span", { className: "text-slate-300 ml-1", children: "\u25B2" });
86
+ }
87
+ return sortDirection === "asc" ? /* @__PURE__ */ jsx2("span", { className: "text-blue-600 ml-1", children: "\u25B2" }) : /* @__PURE__ */ jsx2("span", { className: "text-blue-600 ml-1", children: "\u25BC" });
88
+ };
89
+ const toggleSwitch = (id) => {
90
+ const updatedData = data.map(
91
+ (item) => item.id === id ? __spreadProps(__spreadValues({}, item), { status: !item.status }) : item
92
+ );
93
+ setData(updatedData);
94
+ };
95
+ return /* @__PURE__ */ jsxs2("div", { className: "space-y-5", children: [
96
+ /* @__PURE__ */ jsx2("div", { className: "w-full border border-slate-200 rounded-2xl overflow-hidden", children: /* @__PURE__ */ jsx2("div", { className: "max-h-[420px] overflow-y-auto overflow-x-auto", children: /* @__PURE__ */ jsxs2("table", { className: "w-full text-left border-collapse bg-white", children: [
97
+ /* @__PURE__ */ jsx2("thead", { className: "sticky top-0 z-30 bg-white shadow-sm", children: /* @__PURE__ */ jsxs2("tr", { className: "bg-slate-50/70 border-b border-slate-200 text-xs font-bold uppercase tracking-wider text-slate-500 shadow-sm", children: [
98
+ /* @__PURE__ */ jsx2("th", { className: "bg-slate-50 py-4.5 px-5 w-20 text-center", children: "S.No" }),
99
+ /* @__PURE__ */ jsx2(
100
+ "th",
101
+ {
102
+ onClick: () => handleSort("name"),
103
+ className: "bg-slate-50 py-4.5 px-5 text-sm cursor-pointer select-none hover:text-slate-900",
104
+ children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1", children: [
105
+ "Workflow Name",
106
+ getSortIcon("name")
107
+ ] })
108
+ }
109
+ ),
110
+ /* @__PURE__ */ jsx2(
111
+ "th",
112
+ {
113
+ "bg-slate-50": true,
114
+ onClick: () => handleSort("code"),
115
+ className: "py-4.5 px-5 cursor-pointer select-none hover:text-slate-900",
116
+ children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1", children: [
117
+ "Workflow Code",
118
+ getSortIcon("code")
119
+ ] })
120
+ }
121
+ ),
122
+ /* @__PURE__ */ jsx2(
123
+ "th",
124
+ {
125
+ "bg-slate-50": true,
126
+ onClick: () => handleSort("type"),
127
+ className: "py-4.5 px-5 cursor-pointer select-none hover:text-slate-900",
128
+ children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1", children: [
129
+ "Workflow Type",
130
+ getSortIcon("type")
131
+ ] })
132
+ }
133
+ ),
134
+ /* @__PURE__ */ jsx2(
135
+ "th",
136
+ {
137
+ "bg-slate-50": true,
138
+ onClick: () => handleSort("version"),
139
+ className: "py-4.5 px-5 text-center cursor-pointer select-none hover:text-slate-900",
140
+ children: /* @__PURE__ */ jsxs2("div", { className: "flex justify-center items-center gap-1", children: [
141
+ "Version",
142
+ getSortIcon("version")
143
+ ] })
144
+ }
145
+ ),
146
+ /* @__PURE__ */ jsx2("th", { "bg-slate-50": true, className: "py-4.5 px-5 text-center", children: "Published" }),
147
+ /* @__PURE__ */ jsx2("th", { "bg-slate-50": true, className: "py-4.5 px-5 text-center", children: "Status" })
148
+ ] }) }),
149
+ /* @__PURE__ */ jsx2("tbody", { className: "divide-y divide-slate-100 text-sm text-slate-600", children: visibleData.map((item, index) => /* @__PURE__ */ jsxs2("tr", { className: "hover:bg-slate-50/50 transition-colors", children: [
150
+ /* @__PURE__ */ jsx2("td", { className: "py-4 px-5 text-center font-medium text-slate-400", children: startIndex + index + 1 }),
151
+ /* @__PURE__ */ jsx2("td", { className: "py-4 px-5 font-bold text-slate-900 text-[14px]", children: item.name }),
152
+ /* @__PURE__ */ jsx2("td", { className: "py-4 px-5 text-slate-500", children: item.code }),
153
+ /* @__PURE__ */ jsx2("td", { className: "py-4 px-5 text-slate-500", children: item.type }),
154
+ /* @__PURE__ */ jsx2("td", { className: "py-4 px-5 text-center font-semibold text-slate-700", children: item.version }),
155
+ /* @__PURE__ */ jsx2("td", { className: "py-4 px-5 text-center", children: /* @__PURE__ */ jsx2("span", { className: `px-2.5 py-1 rounded-md text-xs font-medium ${item.published ? "bg-green-50 text-green-700 border border-green-200" : "bg-red-50 text-red-700 border border-red-200"}`, children: item.published ? "\u2713 Yes" : "\u2715 No" }) }),
156
+ /* @__PURE__ */ jsx2("td", { className: "py-4 px-5 text-center", children: /* @__PURE__ */ jsx2("div", { className: "flex justify-center items-center", children: /* @__PURE__ */ jsx2(
157
+ "button",
158
+ {
159
+ type: "button",
160
+ onClick: () => toggleSwitch(item.id),
161
+ className: `relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out outline-none ${item.status ? "bg-blue-600" : "bg-slate-200"}`,
162
+ children: /* @__PURE__ */ jsx2(
163
+ "span",
164
+ {
165
+ className: `pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${item.status ? "translate-x-5" : "translate-x-0"}`
166
+ }
167
+ )
168
+ }
169
+ ) }) })
170
+ ] }, item.id)) })
171
+ ] }) }) }),
172
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-end gap-1 text-[13px] text-slate-700 font-normal mt-4 bg-slate-50/50 p-3 rounded-xl border border-slate-100", children: [
173
+ /* @__PURE__ */ jsx2(
174
+ "button",
175
+ {
176
+ onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)),
177
+ className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors mr-2",
178
+ children: "\u2039 Prev"
179
+ }
180
+ ),
181
+ [1, 2, 3, 4].map((pageNumber) => /* @__PURE__ */ jsx2(
182
+ "button",
183
+ {
184
+ onClick: () => setCurrentPage(pageNumber),
185
+ className: `px-3 py-1 text-center rounded transition-all min-w-[28px] ${currentPage === pageNumber ? "bg-blue-600 text-white font-medium shadow-sm" : "text-slate-600 hover:bg-slate-100"}`,
186
+ children: pageNumber
187
+ },
188
+ pageNumber
189
+ )),
190
+ /* @__PURE__ */ jsx2(
191
+ "button",
192
+ {
193
+ onClick: () => setCurrentPage((prev) => Math.min(prev + 1, 7)),
194
+ className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors ml-2",
195
+ children: "Next \u203A"
196
+ }
197
+ ),
198
+ /* @__PURE__ */ jsx2(
199
+ "button",
200
+ {
201
+ onClick: () => setCurrentPage(7),
202
+ className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors",
203
+ children: "Last"
204
+ }
205
+ )
206
+ ] })
207
+ ] });
208
+ }
209
+
210
+ // src/components/Workflow/AddWorkflowModal.jsx
211
+ import React3 from "react";
212
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
213
+ function AddWorkflowModal({ isOpen, onClose }) {
214
+ if (!isOpen) return null;
215
+ return /* @__PURE__ */ jsxs3("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
216
+ /* @__PURE__ */ jsx3(
52
217
  "div",
53
218
  {
54
219
  className: "fixed inset-0 bg-slate-900/50 backdrop-blur-sm transition-opacity duration-200",
55
220
  onClick: onClose
56
221
  }
57
222
  ),
58
- /* @__PURE__ */ jsxs2("div", { className: "relative w-full max-w-4xl bg-white rounded-3xl shadow-2xl flex flex-col z-10 max-h-[92vh] overflow-hidden animate-in fade-in zoom-in-95 duration-200", children: [
59
- /* @__PURE__ */ jsxs2("div", { className: "flex justify-between items-center px-8 py-6 border-b border-slate-100", children: [
60
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-4", children: [
61
- /* @__PURE__ */ jsx2("div", { className: "w-12 h-12 bg-indigo-50 text-indigo-600 rounded-xl flex items-center justify-center shadow-sm", children: /* @__PURE__ */ jsx2("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx2("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }) }) }),
62
- /* @__PURE__ */ jsxs2("div", { children: [
63
- /* @__PURE__ */ jsx2("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add Workflow" }),
64
- /* @__PURE__ */ jsx2("p", { className: "text-xs text-slate-400 mt-0.5", children: "Create a new workflow and configure its details" })
223
+ /* @__PURE__ */ jsxs3("div", { className: "relative w-full max-w-4xl bg-white rounded-3xl shadow-2xl flex flex-col z-10 max-h-[92vh] overflow-hidden animate-in fade-in zoom-in-95 duration-200", children: [
224
+ /* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-center px-8 py-6 border-b border-slate-100", children: [
225
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-4", children: [
226
+ /* @__PURE__ */ jsx3("div", { className: "w-12 h-12 bg-indigo-50 text-indigo-600 rounded-xl flex items-center justify-center shadow-sm", children: /* @__PURE__ */ jsx3("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx3("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }) }) }),
227
+ /* @__PURE__ */ jsxs3("div", { children: [
228
+ /* @__PURE__ */ jsx3("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add Workflow" }),
229
+ /* @__PURE__ */ jsx3("p", { className: "text-xs text-slate-400 mt-0.5", children: "Create a new workflow and configure its details" })
65
230
  ] })
66
231
  ] }),
67
- /* @__PURE__ */ jsx2(
232
+ /* @__PURE__ */ jsx3(
68
233
  "button",
69
234
  {
70
235
  onClick: onClose,
@@ -73,32 +238,32 @@ function AddWorkflowStepModal({ onClose }) {
73
238
  }
74
239
  )
75
240
  ] }),
76
- /* @__PURE__ */ jsxs2("div", { className: "p-8 space-y-8 overflow-y-auto max-h-[calc(92vh-170px)] bg-slate-50/30", children: [
77
- /* @__PURE__ */ jsxs2("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
78
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
79
- /* @__PURE__ */ jsx2("span", { children: "\u{1F4CB}" }),
80
- /* @__PURE__ */ jsx2("span", { children: "Workflow Information" })
241
+ /* @__PURE__ */ jsxs3("div", { className: "p-8 space-y-8 overflow-y-auto max-h-[calc(92vh-170px)] bg-slate-50/30", children: [
242
+ /* @__PURE__ */ jsxs3("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
243
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
244
+ /* @__PURE__ */ jsx3("span", { children: "\u{1F4CB}" }),
245
+ /* @__PURE__ */ jsx3("span", { children: "Workflow Information" })
81
246
  ] }),
82
- /* @__PURE__ */ jsxs2("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
83
- /* @__PURE__ */ jsxs2("div", { children: [
84
- /* @__PURE__ */ jsxs2("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
247
+ /* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
248
+ /* @__PURE__ */ jsxs3("div", { children: [
249
+ /* @__PURE__ */ jsxs3("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
85
250
  "Workflow Type ",
86
- /* @__PURE__ */ jsx2("span", { className: "text-red-500", children: "*" })
251
+ /* @__PURE__ */ jsx3("span", { className: "text-red-500", children: "*" })
87
252
  ] }),
88
- /* @__PURE__ */ jsxs2("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
89
- /* @__PURE__ */ jsx2("option", { value: "", children: "Select workflow type" }),
90
- /* @__PURE__ */ jsx2("option", { value: "petition", children: "Petition" }),
91
- /* @__PURE__ */ jsx2("option", { value: "building", children: "Building Permission" }),
92
- /* @__PURE__ */ jsx2("option", { value: "leave", children: "Leave" })
253
+ /* @__PURE__ */ jsxs3("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
254
+ /* @__PURE__ */ jsx3("option", { value: "", children: "Select workflow type" }),
255
+ /* @__PURE__ */ jsx3("option", { value: "petition", children: "Petition" }),
256
+ /* @__PURE__ */ jsx3("option", { value: "building", children: "Building Permission" }),
257
+ /* @__PURE__ */ jsx3("option", { value: "leave", children: "Leave" })
93
258
  ] }),
94
- /* @__PURE__ */ jsx2("p", { className: "text-[10px] text-slate-400 mt-1", children: "Choose the category this workflow belongs to" })
259
+ /* @__PURE__ */ jsx3("p", { className: "text-[10px] text-slate-400 mt-1", children: "Choose the category this workflow belongs to" })
95
260
  ] }),
96
- /* @__PURE__ */ jsxs2("div", { children: [
97
- /* @__PURE__ */ jsxs2("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
261
+ /* @__PURE__ */ jsxs3("div", { children: [
262
+ /* @__PURE__ */ jsxs3("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
98
263
  "Workflow Code ",
99
- /* @__PURE__ */ jsx2("span", { className: "text-red-500", children: "*" })
264
+ /* @__PURE__ */ jsx3("span", { className: "text-red-500", children: "*" })
100
265
  ] }),
101
- /* @__PURE__ */ jsx2(
266
+ /* @__PURE__ */ jsx3(
102
267
  "input",
103
268
  {
104
269
  type: "text",
@@ -106,15 +271,15 @@ function AddWorkflowStepModal({ onClose }) {
106
271
  className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
107
272
  }
108
273
  ),
109
- /* @__PURE__ */ jsx2("p", { className: "text-[10px] text-slate-400 mt-1", children: "Unique code for this workflow (e.g., PET-001)" })
274
+ /* @__PURE__ */ jsx3("p", { className: "text-[10px] text-slate-400 mt-1", children: "Unique code for this workflow (e.g., PET-001)" })
110
275
  ] })
111
276
  ] }),
112
- /* @__PURE__ */ jsxs2("div", { children: [
113
- /* @__PURE__ */ jsxs2("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
277
+ /* @__PURE__ */ jsxs3("div", { children: [
278
+ /* @__PURE__ */ jsxs3("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
114
279
  "Workflow Name ",
115
- /* @__PURE__ */ jsx2("span", { className: "text-red-500", children: "*" })
280
+ /* @__PURE__ */ jsx3("span", { className: "text-red-500", children: "*" })
116
281
  ] }),
117
- /* @__PURE__ */ jsx2(
282
+ /* @__PURE__ */ jsx3(
118
283
  "input",
119
284
  {
120
285
  type: "text",
@@ -122,15 +287,15 @@ function AddWorkflowStepModal({ onClose }) {
122
287
  className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
123
288
  }
124
289
  ),
125
- /* @__PURE__ */ jsx2("p", { className: "text-[10px] text-slate-400 mt-1", children: "Enter a descriptive name for this workflow" })
290
+ /* @__PURE__ */ jsx3("p", { className: "text-[10px] text-slate-400 mt-1", children: "Enter a descriptive name for this workflow" })
126
291
  ] }),
127
- /* @__PURE__ */ jsxs2("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
128
- /* @__PURE__ */ jsxs2("div", { children: [
129
- /* @__PURE__ */ jsxs2("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
292
+ /* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
293
+ /* @__PURE__ */ jsxs3("div", { children: [
294
+ /* @__PURE__ */ jsxs3("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
130
295
  "Version ",
131
- /* @__PURE__ */ jsx2("span", { className: "text-red-500", children: "*" })
296
+ /* @__PURE__ */ jsx3("span", { className: "text-red-500", children: "*" })
132
297
  ] }),
133
- /* @__PURE__ */ jsx2(
298
+ /* @__PURE__ */ jsx3(
134
299
  "input",
135
300
  {
136
301
  type: "text",
@@ -138,27 +303,27 @@ function AddWorkflowStepModal({ onClose }) {
138
303
  className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
139
304
  }
140
305
  ),
141
- /* @__PURE__ */ jsx2("p", { className: "text-[10px] text-slate-400 mt-1", children: "Workflow version number" })
306
+ /* @__PURE__ */ jsx3("p", { className: "text-[10px] text-slate-400 mt-1", children: "Workflow version number" })
142
307
  ] }),
143
- /* @__PURE__ */ jsxs2("div", { children: [
144
- /* @__PURE__ */ jsxs2("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
308
+ /* @__PURE__ */ jsxs3("div", { children: [
309
+ /* @__PURE__ */ jsxs3("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
145
310
  "Published ",
146
- /* @__PURE__ */ jsx2("span", { className: "text-red-500", children: "*" })
311
+ /* @__PURE__ */ jsx3("span", { className: "text-red-500", children: "*" })
147
312
  ] }),
148
- /* @__PURE__ */ jsxs2("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
149
- /* @__PURE__ */ jsx2("option", { value: "false", children: "No" }),
150
- /* @__PURE__ */ jsx2("option", { value: "true", children: "Yes" })
313
+ /* @__PURE__ */ jsxs3("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
314
+ /* @__PURE__ */ jsx3("option", { value: "false", children: "No" }),
315
+ /* @__PURE__ */ jsx3("option", { value: "true", children: "Yes" })
151
316
  ] }),
152
- /* @__PURE__ */ jsx2("p", { className: "text-[10px] text-slate-400 mt-1", children: "Make workflow active for use" })
317
+ /* @__PURE__ */ jsx3("p", { className: "text-[10px] text-slate-400 mt-1", children: "Make workflow active for use" })
153
318
  ] })
154
319
  ] })
155
320
  ] }),
156
- /* @__PURE__ */ jsxs2("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-3", children: [
157
- /* @__PURE__ */ jsxs2("div", { className: "flex justify-between items-center", children: [
158
- /* @__PURE__ */ jsx2("label", { className: "block text-xs font-bold text-slate-700", children: "Description" }),
159
- /* @__PURE__ */ jsx2("span", { className: "text-[10px] text-slate-400", children: "0 / 500" })
321
+ /* @__PURE__ */ jsxs3("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-3", children: [
322
+ /* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-center", children: [
323
+ /* @__PURE__ */ jsx3("label", { className: "block text-xs font-bold text-slate-700", children: "Description" }),
324
+ /* @__PURE__ */ jsx3("span", { className: "text-[10px] text-slate-400", children: "0 / 500" })
160
325
  ] }),
161
- /* @__PURE__ */ jsx2(
326
+ /* @__PURE__ */ jsx3(
162
327
  "textarea",
163
328
  {
164
329
  rows: 3,
@@ -166,86 +331,86 @@ function AddWorkflowStepModal({ onClose }) {
166
331
  className: "w-full p-3 border border-slate-200 rounded-xl text-xs resize-none focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
167
332
  }
168
333
  ),
169
- /* @__PURE__ */ jsx2("p", { className: "text-[10px] text-slate-400", children: "Provide additional information about this workflow" })
334
+ /* @__PURE__ */ jsx3("p", { className: "text-[10px] text-slate-400", children: "Provide additional information about this workflow" })
170
335
  ] }),
171
- /* @__PURE__ */ jsxs2("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
172
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
173
- /* @__PURE__ */ jsx2("span", { children: "\u2699\uFE0F" }),
174
- /* @__PURE__ */ jsx2("span", { children: "Status & Settings" })
336
+ /* @__PURE__ */ jsxs3("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
337
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
338
+ /* @__PURE__ */ jsx3("span", { children: "\u2699\uFE0F" }),
339
+ /* @__PURE__ */ jsx3("span", { children: "Status & Settings" })
175
340
  ] }),
176
- /* @__PURE__ */ jsxs2("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
177
- /* @__PURE__ */ jsxs2("div", { children: [
178
- /* @__PURE__ */ jsxs2("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
341
+ /* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
342
+ /* @__PURE__ */ jsxs3("div", { children: [
343
+ /* @__PURE__ */ jsxs3("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
179
344
  "Status ",
180
- /* @__PURE__ */ jsx2("span", { className: "text-red-500", children: "*" })
345
+ /* @__PURE__ */ jsx3("span", { className: "text-red-500", children: "*" })
181
346
  ] }),
182
- /* @__PURE__ */ jsxs2("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
183
- /* @__PURE__ */ jsx2("option", { value: "active", children: "Active" }),
184
- /* @__PURE__ */ jsx2("option", { value: "inactive", children: "Inactive" })
347
+ /* @__PURE__ */ jsxs3("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
348
+ /* @__PURE__ */ jsx3("option", { value: "active", children: "Active" }),
349
+ /* @__PURE__ */ jsx3("option", { value: "inactive", children: "Inactive" })
185
350
  ] }),
186
- /* @__PURE__ */ jsx2("p", { className: "text-[10px] text-slate-400 mt-1", children: "Set the initial status of this workflow" })
351
+ /* @__PURE__ */ jsx3("p", { className: "text-[10px] text-slate-400 mt-1", children: "Set the initial status of this workflow" })
187
352
  ] }),
188
- /* @__PURE__ */ jsxs2("div", { children: [
189
- /* @__PURE__ */ jsx2("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: "Default Priority" }),
190
- /* @__PURE__ */ jsxs2("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
191
- /* @__PURE__ */ jsx2("option", { value: "medium", children: "Medium" }),
192
- /* @__PURE__ */ jsx2("option", { value: "high", children: "High" }),
193
- /* @__PURE__ */ jsx2("option", { value: "low", children: "Low" })
353
+ /* @__PURE__ */ jsxs3("div", { children: [
354
+ /* @__PURE__ */ jsx3("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: "Default Priority" }),
355
+ /* @__PURE__ */ jsxs3("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
356
+ /* @__PURE__ */ jsx3("option", { value: "medium", children: "Medium" }),
357
+ /* @__PURE__ */ jsx3("option", { value: "high", children: "High" }),
358
+ /* @__PURE__ */ jsx3("option", { value: "low", children: "Low" })
194
359
  ] }),
195
- /* @__PURE__ */ jsx2("p", { className: "text-[10px] text-slate-400 mt-1", children: "Default priority for tasks in this workflow" })
360
+ /* @__PURE__ */ jsx3("p", { className: "text-[10px] text-slate-400 mt-1", children: "Default priority for tasks in this workflow" })
196
361
  ] })
197
362
  ] })
198
363
  ] }),
199
- /* @__PURE__ */ jsxs2("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
200
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
201
- /* @__PURE__ */ jsx2("span", { children: "\u{1F6E0}\uFE0F" }),
202
- /* @__PURE__ */ jsx2("span", { children: "Additional Settings" })
364
+ /* @__PURE__ */ jsxs3("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
365
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
366
+ /* @__PURE__ */ jsx3("span", { children: "\u{1F6E0}\uFE0F" }),
367
+ /* @__PURE__ */ jsx3("span", { children: "Additional Settings" })
203
368
  ] }),
204
- /* @__PURE__ */ jsxs2("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
205
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
206
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3", children: [
207
- /* @__PURE__ */ jsx2("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u23F1\uFE0F" }),
208
- /* @__PURE__ */ jsxs2("div", { children: [
209
- /* @__PURE__ */ jsx2("p", { className: "text-xs font-bold text-slate-700", children: "Enable SLA" }),
210
- /* @__PURE__ */ jsx2("p", { className: "text-[9px] text-slate-400", children: "Enable SLA for workflow" })
369
+ /* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
370
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
371
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
372
+ /* @__PURE__ */ jsx3("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u23F1\uFE0F" }),
373
+ /* @__PURE__ */ jsxs3("div", { children: [
374
+ /* @__PURE__ */ jsx3("p", { className: "text-xs font-bold text-slate-700", children: "Enable SLA" }),
375
+ /* @__PURE__ */ jsx3("p", { className: "text-[9px] text-slate-400", children: "Enable SLA for workflow" })
211
376
  ] })
212
377
  ] }),
213
- /* @__PURE__ */ jsxs2("label", { className: "relative inline-flex items-center cursor-pointer", children: [
214
- /* @__PURE__ */ jsx2("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
215
- /* @__PURE__ */ jsx2("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
378
+ /* @__PURE__ */ jsxs3("label", { className: "relative inline-flex items-center cursor-pointer", children: [
379
+ /* @__PURE__ */ jsx3("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
380
+ /* @__PURE__ */ jsx3("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
216
381
  ] })
217
382
  ] }),
218
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
219
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3", children: [
220
- /* @__PURE__ */ jsx2("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F504}" }),
221
- /* @__PURE__ */ jsxs2("div", { children: [
222
- /* @__PURE__ */ jsx2("p", { className: "text-xs font-bold text-slate-700", children: "Allow Rework" }),
223
- /* @__PURE__ */ jsx2("p", { className: "text-[9px] text-slate-400", children: "Allow files to be sent back" })
383
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
384
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
385
+ /* @__PURE__ */ jsx3("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F504}" }),
386
+ /* @__PURE__ */ jsxs3("div", { children: [
387
+ /* @__PURE__ */ jsx3("p", { className: "text-xs font-bold text-slate-700", children: "Allow Rework" }),
388
+ /* @__PURE__ */ jsx3("p", { className: "text-[9px] text-slate-400", children: "Allow files to be sent back" })
224
389
  ] })
225
390
  ] }),
226
- /* @__PURE__ */ jsxs2("label", { className: "relative inline-flex items-center cursor-pointer", children: [
227
- /* @__PURE__ */ jsx2("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
228
- /* @__PURE__ */ jsx2("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
391
+ /* @__PURE__ */ jsxs3("label", { className: "relative inline-flex items-center cursor-pointer", children: [
392
+ /* @__PURE__ */ jsx3("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
393
+ /* @__PURE__ */ jsx3("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
229
394
  ] })
230
395
  ] }),
231
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
232
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3", children: [
233
- /* @__PURE__ */ jsx2("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F465}" }),
234
- /* @__PURE__ */ jsxs2("div", { children: [
235
- /* @__PURE__ */ jsx2("p", { className: "text-xs font-bold text-slate-700", children: "Allow File Delegation" }),
236
- /* @__PURE__ */ jsx2("p", { className: "text-[9px] text-slate-400", children: "Allow users to delegate tasks" })
396
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
397
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
398
+ /* @__PURE__ */ jsx3("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F465}" }),
399
+ /* @__PURE__ */ jsxs3("div", { children: [
400
+ /* @__PURE__ */ jsx3("p", { className: "text-xs font-bold text-slate-700", children: "Allow File Delegation" }),
401
+ /* @__PURE__ */ jsx3("p", { className: "text-[9px] text-slate-400", children: "Allow users to delegate tasks" })
237
402
  ] })
238
403
  ] }),
239
- /* @__PURE__ */ jsxs2("label", { className: "relative inline-flex items-center cursor-pointer", children: [
240
- /* @__PURE__ */ jsx2("input", { type: "checkbox", className: "sr-only peer" }),
241
- /* @__PURE__ */ jsx2("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
404
+ /* @__PURE__ */ jsxs3("label", { className: "relative inline-flex items-center cursor-pointer", children: [
405
+ /* @__PURE__ */ jsx3("input", { type: "checkbox", className: "sr-only peer" }),
406
+ /* @__PURE__ */ jsx3("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
242
407
  ] })
243
408
  ] })
244
409
  ] })
245
410
  ] })
246
411
  ] }),
247
- /* @__PURE__ */ jsxs2("div", { className: "p-5 bg-white border-t border-slate-100 flex items-center justify-end gap-3 px-8", children: [
248
- /* @__PURE__ */ jsx2(
412
+ /* @__PURE__ */ jsxs3("div", { className: "p-5 bg-white border-t border-slate-100 flex items-center justify-end gap-3 px-8", children: [
413
+ /* @__PURE__ */ jsx3(
249
414
  "button",
250
415
  {
251
416
  onClick: onClose,
@@ -253,7 +418,7 @@ function AddWorkflowStepModal({ onClose }) {
253
418
  children: "\u2715 Cancel"
254
419
  }
255
420
  ),
256
- /* @__PURE__ */ jsx2(
421
+ /* @__PURE__ */ jsx3(
257
422
  "button",
258
423
  {
259
424
  type: "button",
@@ -266,217 +431,90 @@ function AddWorkflowStepModal({ onClose }) {
266
431
  ] });
267
432
  }
268
433
 
269
- // src/components/WorkflowStep/main.js
270
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
271
- var workflowSteps = [
272
- {
273
- workflowStepId: 1,
274
- workflowId: 1,
275
- stepCode: "SCR",
276
- stepName: "Scrutiny",
277
- sequenceNo: 1,
278
- slaType: "Hours",
279
- slaValue: 48,
280
- reminderBefore: 4,
281
- escalationAfter: 48,
282
- workingHoursOnly: 1,
283
- excludeHolidays: 1
284
- },
285
- {
286
- workflowStepId: 2,
287
- workflowId: 1,
288
- stepCode: "APR",
289
- stepName: "Approval",
290
- sequenceNo: 2,
291
- slaType: "Days",
292
- slaValue: 2,
293
- reminderBefore: 1,
294
- escalationAfter: 2,
295
- workingHoursOnly: 1,
296
- excludeHolidays: 1
297
- },
298
- {
299
- workflowStepId: 3,
300
- workflowId: 1,
301
- stepCode: "APR",
302
- stepName: "Approval",
303
- sequenceNo: 3,
304
- slaType: "Days",
305
- slaValue: 2,
306
- reminderBefore: 1,
307
- escalationAfter: 2,
308
- workingHoursOnly: 1,
309
- excludeHolidays: 1
310
- },
311
- {
312
- workflowStepId: 4,
313
- workflowId: 1,
314
- stepCode: "APR",
315
- stepName: "Approval",
316
- sequenceNo: 4,
317
- slaType: "Days",
318
- slaValue: 2,
319
- reminderBefore: 1,
320
- escalationAfter: 2,
321
- workingHoursOnly: 1,
322
- excludeHolidays: 1
323
- },
324
- {
325
- workflowStepId: 5,
326
- workflowId: 1,
327
- stepCode: "APR",
328
- stepName: "Approval",
329
- sequenceNo: 5,
330
- slaType: "Days",
331
- slaValue: 2,
332
- reminderBefore: 1,
333
- escalationAfter: 2,
334
- workingHoursOnly: 1,
335
- excludeHolidays: 1
336
- }
337
- ];
338
- function WorkflowStep() {
339
- const [showModal, setShowModal] = useState(false);
340
- const [pageSize, setPageSize] = useState(5);
341
- const [sortConfig, setSortConfig] = useState({
342
- key: "",
343
- direction: "asc"
344
- });
345
- const handleSort = (key) => {
346
- let direction = "asc";
347
- if (sortConfig.key === key && sortConfig.direction === "asc") {
348
- direction = "desc";
434
+ // src/components/Workflow/AddButton.jsx
435
+ import React4 from "react";
436
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
437
+ function AddButton({ onOpen }) {
438
+ return /* @__PURE__ */ jsxs4(
439
+ "button",
440
+ {
441
+ onClick: onOpen,
442
+ className: "bg-blue-600 hover:bg-blue-700 text-white px-5 py-2.5 rounded-xl font-bold text-sm shadow-md shadow-blue-500/20 hover:shadow-lg hover:shadow-blue-500/30 transition-all active:scale-95 flex items-center gap-2",
443
+ children: [
444
+ /* @__PURE__ */ jsx4("svg", { className: "w-4 h-4 stroke-[2.5]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx4("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) }),
445
+ "Add New Workflow"
446
+ ]
349
447
  }
350
- setSortConfig({
351
- key,
352
- direction
353
- });
354
- };
355
- return /* @__PURE__ */ jsx3("div", { className: "p-6 bg-[#f5f7fb] min-h-screen font-sans text-slate-700", children: /* @__PURE__ */ jsxs3("div", { className: "bg-white rounded-2xl shadow-md overflow-hidden", children: [
356
- /* @__PURE__ */ jsxs3("div", { className: "px-6 py-5 border-b border-gray-200", children: [
357
- /* @__PURE__ */ jsx3("h1", { className: "m-0 text-[30px] leading-tight font-semibold text-[#1E293B] tracking-tight", children: "Workflow Step" }),
358
- /* @__PURE__ */ jsxs3("div", { className: "mt-2 text-[13px] font-medium", children: [
359
- /* @__PURE__ */ jsx3("a", { href: "/dashboard", className: "text-blue-600 hover:underline", children: "Dashboard" }),
360
- /* @__PURE__ */ jsx3("span", { className: "mx-2 text-slate-400", children: ">" }),
361
- /* @__PURE__ */ jsx3("a", { href: "/masters", className: "text-blue-600 hover:underline", children: "Masters" }),
362
- /* @__PURE__ */ jsx3("span", { className: "mx-2 text-slate-400", children: ">" }),
363
- /* @__PURE__ */ jsx3("a", { href: "/workflow", className: "text-blue-600 hover:underline", children: "Workflow" }),
364
- /* @__PURE__ */ jsx3("span", { className: "mx-2 text-slate-400", children: ">" }),
365
- /* @__PURE__ */ jsx3("span", { className: "text-slate-500", children: "Workflow Step" })
366
- ] })
367
- ] }),
368
- /* @__PURE__ */ jsx3("div", { className: "px-6 py-5 border-b border-gray-200 ", children: /* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-center flex-wrap gap-3", children: [
369
- /* @__PURE__ */ jsx3(
370
- "input",
371
- {
372
- type: "text",
373
- placeholder: "Search workflow step...",
374
- className: "w-[300px] px-4 py-2.5 border border-slate-200/80 rounded-lg text-[13px] text-slate-600 focus:outline-none bg-slate-50"
375
- }
376
- ),
377
- /* @__PURE__ */ jsxs3("div", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: [
378
- /* @__PURE__ */ jsx3("span", { children: "Show" }),
379
- /* @__PURE__ */ jsxs3(
380
- "select",
381
- {
382
- value: pageSize,
383
- onChange: (e) => setPageSize(Number(e.target.value)),
384
- className: "inline-flex item-center px-3 py-1 rounded-md bg-[#f1f5f9] text-[#334155] text-xs font-semibold border border-[#e2e8f0]",
385
- children: [
386
- /* @__PURE__ */ jsx3("option", { value: 5, children: "5" }),
387
- /* @__PURE__ */ jsx3("option", { value: 10, children: "10" }),
388
- /* @__PURE__ */ jsx3("option", { value: 25, children: "25" })
389
- ]
390
- }
391
- ),
392
- /* @__PURE__ */ jsx3("span", { children: "entries" })
393
- ] }),
394
- /* @__PURE__ */ jsx3(
395
- "button",
396
- {
397
- onClick: () => setShowModal(true),
398
- className: "px-5 py-2.5 bg-blue-600 text-white rounded-lg text-[13px] font-semibold hover:bg-blue-700 transition-colors",
399
- children: "+ Add Workflow Step"
400
- }
401
- )
402
- ] }) }),
403
- /* @__PURE__ */ jsxs3("div", { className: "overflow-x-auto", children: [
404
- /* @__PURE__ */ jsxs3("table", { className: "w-full border-collapse", children: [
405
- /* @__PURE__ */ jsx3("thead", { children: /* @__PURE__ */ jsx3("tr", { className: "bg-slate-50/70 border-b border-slate-200 text-xs font-bold uppercase tracking-wider text-slate-500", children: [
406
- { label: "WorkflowStepId", key: "workflowStepId" },
407
- { label: "WorkflowId", key: "workflowId" },
408
- { label: "StepCode", key: "stepCode" },
409
- { label: "StepName", key: "stepName" },
410
- { label: "SequenceNo", key: "sequenceNo" },
411
- { label: "SLA Type", key: "slaType" },
412
- { label: "SLA Value", key: "slaValue" },
413
- { label: "Reminder Before", key: "reminderBefore" },
414
- { label: "Escalation After", key: "escalationAfter" },
415
- { label: "Working Hours Only", key: "workingHoursOnly" },
416
- { label: "Exclude Holidays", key: "excludeHolidays" }
417
- ].map((column) => /* @__PURE__ */ jsx3(
418
- "th",
419
- {
420
- onClick: () => handleSort(column.key),
421
- className: "px-4 py-3 text-left border-b border-gray-200 text-[11px] font-bold uppercase tracking-wider text-slate-500",
422
- children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
423
- /* @__PURE__ */ jsx3("span", { children: column.label }),
424
- /* @__PURE__ */ jsx3("span", { className: "text-gray-400 text-xs", children: sortConfig.key === column.key ? sortConfig.direction === "asc" ? "\u25B2" : "\u25BC" : "\u2195" })
425
- ] })
426
- },
427
- column.key
428
- )) }) }),
429
- /* @__PURE__ */ jsx3("tbody", { children: workflowSteps.slice(0, pageSize).map((item) => /* @__PURE__ */ jsxs3(
430
- "tr",
431
- {
432
- className: "hover:bg-slate-50 transition-colors",
433
- children: [
434
- /* @__PURE__ */ jsx3("td", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.workflowStepId }),
435
- /* @__PURE__ */ jsx3("td", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.workflowId }),
436
- /* @__PURE__ */ jsx3("td", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: /* @__PURE__ */ jsx3("span", { className: "inline-flex item-center px-3 py-1 rounded-md bg-[#f1f5f9] text-[#334155] text-xs font-semibold border border-[#e2e8f0]", children: item.stepCode }) }),
437
- /* @__PURE__ */ jsx3("td", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.stepName }),
438
- /* @__PURE__ */ jsx3("td", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.sequenceNo }),
439
- /* @__PURE__ */ jsx3("td", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.slaType }),
440
- /* @__PURE__ */ jsx3("td", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.slaValue }),
441
- /* @__PURE__ */ jsx3("td", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.reminderBefore }),
442
- /* @__PURE__ */ jsx3("td", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.escalationAfter }),
443
- /* @__PURE__ */ jsx3("td", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.workingHoursOnly }),
444
- /* @__PURE__ */ jsx3("td", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.excludeHolidays })
445
- ]
446
- },
447
- item.workflowStepId
448
- )) })
449
- ] }),
450
- /* @__PURE__ */ jsx3("div", { className: "h-5" }),
451
- /* @__PURE__ */ jsx3(Footer, {}),
452
- showModal && /* @__PURE__ */ jsx3(AddWorkflowStepModal, { onClose: () => setShowModal(false) })
453
- ] })
454
- ] }) });
448
+ );
455
449
  }
456
450
 
457
- // src/pages/workflow.js
458
- import { jsx as jsx4 } from "react/jsx-runtime";
451
+ // src/pages/WorkflowPage.js
452
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
459
453
  function WorkflowPage() {
460
- return /* @__PURE__ */ jsx4(WorkflowStep, {});
461
- }
462
-
463
- // src/components/Sidebar.jsx
464
- import { useState as useState8 } from "react";
465
- import {
466
- RiMenuLine,
467
- RiGitMergeLine,
468
- RiNodeTree,
469
- RiGitBranchLine,
470
- RiCornerDownRightLine,
471
- RiUserSettingsLine,
472
- RiFileShieldLine,
473
- RiUserSharedLine,
474
- RiSettings4Line,
475
- RiFileSettingsLine,
476
- RiFileList3Line,
477
- RiFileUploadLine,
478
- RiNotification4Line,
479
- RiDatabase2Line,
454
+ const [modalOpen, setModalOpen] = useState2(false);
455
+ const [pageSize, setPageSize] = useState2(10);
456
+ return /* @__PURE__ */ jsxs5("div", { className: "h-screen bg-slate-50 p-6 flex flex-col", children: [
457
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-col flex-1 gap-5 overflow-hidden", children: [
458
+ /* @__PURE__ */ jsx5("div", { className: "bg-white rounded-2xl shadow-sm p-6", children: /* @__PURE__ */ jsxs5("div", { className: "flex justify-between items-center", children: [
459
+ /* @__PURE__ */ jsxs5("div", { children: [
460
+ /* @__PURE__ */ jsx5("h1", { className: "text-2xl font-extrabold text-slate-900", children: "Workflow" }),
461
+ /* @__PURE__ */ jsxs5("p", { className: "text-xs text-slate-400 mt-1", children: [
462
+ "Dashboard > Workflow >",
463
+ /* @__PURE__ */ jsxs5("span", { className: "text-blue-600 font-semibold", children: [
464
+ " ",
465
+ "Manage Workflows"
466
+ ] })
467
+ ] })
468
+ ] }),
469
+ /* @__PURE__ */ jsx5(AddButton, { onOpen: () => setModalOpen(true) })
470
+ ] }) }),
471
+ /* @__PURE__ */ jsxs5("div", { className: "bg-white border border-slate-200 rounded-2xl shadow-sm p-6 flex flex-col flex-1 overflow-hidden", children: [
472
+ /* @__PURE__ */ jsxs5("div", { className: "flex justify-between items-center mb-5", children: [
473
+ /* @__PURE__ */ jsx5("div", { className: "w-full max-w-sm", children: /* @__PURE__ */ jsx5(SearchBar, {}) }),
474
+ /* @__PURE__ */ jsxs5(
475
+ "select",
476
+ {
477
+ value: pageSize,
478
+ onChange: (e) => setPageSize(Number(e.target.value)),
479
+ className: "border border-slate-200 rounded-xl px-4 py-2 text-sm outline-none bg-white",
480
+ children: [
481
+ /* @__PURE__ */ jsx5("option", { value: 5, children: "5 Rows" }),
482
+ /* @__PURE__ */ jsx5("option", { value: 10, children: "10 Rows" }),
483
+ /* @__PURE__ */ jsx5("option", { value: 20, children: "20 Rows" })
484
+ ]
485
+ }
486
+ )
487
+ ] }),
488
+ /* @__PURE__ */ jsx5("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx5(WorkflowTable, { pageSize }) })
489
+ ] })
490
+ ] }),
491
+ /* @__PURE__ */ jsx5(
492
+ AddWorkflowModal,
493
+ {
494
+ isOpen: modalOpen,
495
+ onClose: () => setModalOpen(false)
496
+ }
497
+ )
498
+ ] });
499
+ }
500
+
501
+ // src/components/Sidebar.jsx
502
+ import { useState as useState7 } from "react";
503
+ import {
504
+ RiMenuLine,
505
+ RiGitMergeLine,
506
+ RiNodeTree,
507
+ RiGitBranchLine,
508
+ RiCornerDownRightLine,
509
+ RiUserSettingsLine,
510
+ RiFileShieldLine,
511
+ RiUserSharedLine,
512
+ RiSettings4Line,
513
+ RiFileSettingsLine,
514
+ RiFileList3Line,
515
+ RiFileUploadLine,
516
+ RiNotification4Line,
517
+ RiDatabase2Line,
480
518
  RiChat3Line,
481
519
  RiCheckboxMultipleLine,
482
520
  RiShieldCheckLine,
@@ -486,918 +524,361 @@ import {
486
524
  } from "@remixicon/react";
487
525
  import { useRouter } from "next/router";
488
526
 
489
- // src/components/workflowMaster/workFlowMasterMain.js
490
- import { useState as useState3 } from "react";
527
+ // src/components/WorkflowType/WorkflowTypeMains.js
528
+ import React10, { useState as useState4 } from "react";
491
529
 
492
- // src/components/workflowMaster/workflowTable.jsx
493
- import { useState as useState2, useEffect } from "react";
494
- import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
495
- function WorkflowTable({
496
- search = "",
497
- workflows = [],
498
- workflowtoggle,
499
- entriesPerPage,
500
- setEntriesPerPage
501
- }) {
502
- const [sortField, setSortField] = useState2("");
503
- const [sortDirection, setSortDirection] = useState2("asc");
504
- const [currentPage, setCurrentPage] = useState2(100);
505
- useEffect(() => {
506
- setCurrentPage(100);
507
- }, [search]);
508
- const handleSort = (field) => {
509
- if (sortField === field) {
510
- setSortDirection(sortDirection === "asc" ? "desc" : "asc");
511
- } else {
512
- setSortField(field);
513
- setSortDirection("asc");
530
+ // src/components/WorkflowType/SearchBar.jsx
531
+ import React6 from "react";
532
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
533
+ function SearchBar2({ searchQuery, setSearchQuery, setCurrentPage }) {
534
+ const handleChange = (e) => {
535
+ setSearchQuery(e.target.value);
536
+ if (setCurrentPage) {
537
+ setCurrentPage(1);
514
538
  }
515
539
  };
516
- const filteredworkflows = workflows.filter(
517
- (workflow) => {
518
- var _a, _b;
519
- return ((_a = workflow == null ? void 0 : workflow.name) == null ? void 0 : _a.toLowerCase().includes(search.toLowerCase())) || ((_b = workflow == null ? void 0 : workflow.workflowcode) == null ? void 0 : _b.toLowerCase().includes(search.toLowerCase()));
520
- }
521
- );
522
- const sortedWorkflows = [...filteredworkflows].sort((a, b) => {
523
- if (!sortField) return 0;
524
- let valA = a[sortField] !== void 0 && a[sortField] !== null ? a[sortField].toString().toLowerCase() : "";
525
- let valB = b[sortField] !== void 0 && b[sortField] !== null ? b[sortField].toString().toLowerCase() : "";
526
- if (sortField === "version") {
527
- valA = Number(a[sortField]) || 0;
528
- valB = Number(b[sortField]) || 0;
529
- }
530
- if (valA < valB) return sortDirection === "asc" ? -1 : 1;
531
- if (valA > valB) return sortDirection === "asc" ? 1 : -1;
532
- return 0;
540
+ return /* @__PURE__ */ jsxs6("div", { className: "relative w-full", children: [
541
+ /* @__PURE__ */ jsx6("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-slate-400", children: /* @__PURE__ */ jsx6("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) }),
542
+ /* @__PURE__ */ jsx6(
543
+ "input",
544
+ {
545
+ type: "text",
546
+ value: searchQuery || "",
547
+ onChange: handleChange,
548
+ placeholder: "Search workflow name or code...",
549
+ className: "w-full pl-9 pr-4 py-2 bg-white border border-slate-200 rounded-xl text-sm text-slate-800 placeholder-slate-400 outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500 transition-all shadow-sm"
550
+ }
551
+ ),
552
+ searchQuery && /* @__PURE__ */ jsx6(
553
+ "button",
554
+ {
555
+ onClick: () => {
556
+ setSearchQuery("");
557
+ if (setCurrentPage) setCurrentPage(1);
558
+ },
559
+ className: "absolute inset-y-0 right-0 pr-3 flex items-center text-slate-400 hover:text-slate-600",
560
+ children: "\u2715"
561
+ }
562
+ )
563
+ ] });
564
+ }
565
+
566
+ // src/components/WorkflowType/WorkflowTypeTable.jsx
567
+ import React7, { useState as useState3, useEffect } from "react";
568
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
569
+ function WorkflowTypeTable({ pageSize, searchQuery = "", currentPage, setCurrentPage, setTotalEntries }) {
570
+ const initialData = [
571
+ { id: 1, workflowName: "Citizen Petition Workflow", workflowCode: "PET-001", workflowType: "Petition", version: 1, published: true, status: true },
572
+ { id: 2, workflowName: "Building Permission Workflow", workflowCode: "BLD-001", workflowType: "Building Permission", version: 1, published: true, status: true },
573
+ { id: 3, workflowName: "Leave Application Workflow", workflowCode: "LEV-001", workflowType: "Leave", version: 1, published: false, status: true },
574
+ { id: 4, workflowName: "Grievance Redressal Workflow", workflowCode: "GRV-001", workflowType: "Grievance", version: 2, published: true, status: true },
575
+ { id: 5, workflowName: "Trade License Workflow", workflowCode: "TRD-001", workflowType: "Trade License", version: 1, published: true, status: true },
576
+ { id: 6, workflowName: "Document Verification", workflowCode: "DOC-001", workflowType: "Verification", version: 1, published: true, status: true },
577
+ { id: 7, workflowName: "Water Connection Approval", workflowCode: "WTR-002", workflowType: "Utility", version: 2, published: true, status: true },
578
+ { id: 8, workflowName: "Property Tax Assessment", workflowCode: "TAX-001", workflowType: "Revenue", version: 3, published: true, status: false },
579
+ { id: 9, workflowName: "Vendor Registration", workflowCode: "VND-005", workflowType: "Procurement", version: 1, published: false, status: true },
580
+ { id: 10, workflowName: "Birth Certificate Request", workflowCode: "CRT-001", workflowType: "Vital Stats", version: 1, published: true, status: true },
581
+ { id: 11, workflowName: "Death Certificate Request", workflowCode: "CRT-002", workflowType: "Vital Stats", version: 1, published: true, status: true },
582
+ { id: 12, workflowName: "Road Repair Request", workflowCode: "PWD-003", workflowType: "Public Works", version: 2, published: true, status: true },
583
+ { id: 13, workflowName: "Waste Collection Issue", workflowCode: "SAN-001", workflowType: "Sanitation", version: 1, published: false, status: false },
584
+ { id: 14, workflowName: "Fire NOC Approval", workflowCode: "FIR-001", workflowType: "Safety", version: 4, published: true, status: true },
585
+ { id: 15, workflowName: "Health License Approval", workflowCode: "HLT-002", workflowType: "Health", version: 1, published: true, status: true },
586
+ { id: 16, workflowName: "Advertisement Board Perm", workflowCode: "ADV-001", workflowType: "License", version: 2, published: true, status: true },
587
+ { id: 17, workflowName: "Marriage Registration", workflowCode: "REG-004", workflowType: "Vital Stats", version: 1, published: true, status: true },
588
+ { id: 18, workflowName: "RTI Application Flow", workflowCode: "RTI-001", workflowType: "Information", version: 1, published: true, status: true },
589
+ { id: 19, workflowName: "Contractor Empanelment", workflowCode: "CNT-002", workflowType: "Procurement", version: 2, published: false, status: true },
590
+ { id: 20, workflowName: "Streetlight Maintenance", workflowCode: "ELE-001", workflowType: "Public Works", version: 1, published: true, status: true },
591
+ { id: 21, workflowName: "Park Booking Approval", workflowCode: "PRK-001", workflowType: "Services", version: 1, published: true, status: false },
592
+ { id: 22, workflowName: "Drainage Issue Escalation", workflowCode: "SAN-002", workflowType: "Sanitation", version: 3, published: true, status: true },
593
+ { id: 23, workflowName: "Community Hall Booking", workflowCode: "CHB-001", workflowType: "Services", version: 1, published: true, status: true },
594
+ { id: 24, workflowName: "Seismic Clearance Flow", workflowCode: "ENV-001", workflowType: "Environment", version: 1, published: false, status: false },
595
+ { id: 25, workflowName: "Tree Cutting Permission", workflowCode: "ENV-002", workflowType: "Environment", version: 2, published: true, status: true }
596
+ ];
597
+ const [data, setData] = useState3(initialData);
598
+ const [sortOrder, setSortOrder] = useState3("asc");
599
+ const [sortKey, setSortKey] = useState3("workflowName");
600
+ const handleSort = (columnKey) => {
601
+ const isAsc = sortKey === columnKey && sortOrder === "asc";
602
+ setSortOrder(isAsc ? "desc" : "asc");
603
+ setSortKey(columnKey);
604
+ const sortedData = [...data].sort((a, b) => {
605
+ if (a[columnKey] < b[columnKey]) return isAsc ? -1 : 1;
606
+ if (a[columnKey] > b[columnKey]) return isAsc ? 1 : -1;
607
+ return 0;
608
+ });
609
+ setData(sortedData);
610
+ };
611
+ const filteredData = data.filter((item) => {
612
+ const query = (searchQuery || "").toLowerCase();
613
+ return item.workflowName.toLowerCase().includes(query) || item.workflowCode.toLowerCase().includes(query) || item.workflowType.toLowerCase().includes(query);
533
614
  });
534
- const totalEntries = sortedWorkflows.length;
535
- const totalPages = Math.ceil(totalEntries / (entriesPerPage || 10)) || 1;
536
- const activePage = currentPage > totalPages ? 1 : currentPage;
537
- const indexOfLastEntry = activePage * (entriesPerPage || 10);
538
- const indexOfFirstEntry = indexOfLastEntry - (entriesPerPage || 10);
539
- const currentDisplayedWorkflows = sortedWorkflows.slice(indexOfFirstEntry, indexOfLastEntry);
540
- const renderSortIcon = (field) => {
541
- if (sortField !== field) {
542
- return /* @__PURE__ */ jsx5("svg", { className: "w-3.5 h-3.5 text-slate-300", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { d: "M12 3.25a.75.75 0 01.53.22l3.25 3.25a.75.75 0 11-1.06 1.06L12.75 5.81v12.38l1.97-1.97a.75.75 0 111.06 1.06l-3.25 3.25a.75.75 0 01-1.06 0l-3.25-3.25a.75.75 0 111.06-1.06l1.97 1.97V5.81L9.28 7.78a.75.75 0 01-1.06-1.06l3.25-3.25a.75.75 0 01.53-.22z" }) });
543
- }
544
- return sortDirection === "asc" ? /* @__PURE__ */ jsx5("svg", { className: "w-3.5 h-3.5 text-blue-600", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { d: "M12.53 3.47a.75.75 0 00-1.06 0l-4 4a.75.75 0 001.06 1.06L11 5.81V19a.75.75 0 001.5 0V5.81l2.47 2.47a.75.75 0 001.06-1.06l-4-4z" }) }) : /* @__PURE__ */ jsx5("svg", { className: "w-3.5 h-3.5 text-blue-600", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { d: "M11.47 20.53a.75.75 0 001.06 0l4-4a.75.75 0 00-1.06-1.06L13 18.19V5a.75.75 0 00-1.5 0v13.19l-2.47-2.47a.75.75 0 00-1.06 1.06l4 4z" }) });
615
+ useEffect(() => {
616
+ if (setTotalEntries) setTotalEntries(filteredData.length);
617
+ }, [filteredData.length, setTotalEntries]);
618
+ const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
619
+ const startIndex = (currentPage - 1) * pageSize;
620
+ const visibleData = filteredData.slice(startIndex, startIndex + pageSize);
621
+ const pageNumbers = Array.from({ length: totalPages }, (_, i) => i + 1);
622
+ const toggleStatus = (id) => {
623
+ setData((prev) => prev.map((item) => item.id === id ? __spreadProps(__spreadValues({}, item), { status: !item.status }) : item));
545
624
  };
546
- return /* @__PURE__ */ jsxs4("div", { className: "space-y-6", children: [
547
- /* @__PURE__ */ jsx5("div", { className: "border border-slate-100 rounded-2xl overflow-hidden bg-white shadow-sm", children: /* @__PURE__ */ jsxs4("table", { className: "w-full border-collapse", children: [
548
- /* @__PURE__ */ jsx5("thead", { className: "bg-[#f8fafc]", children: /* @__PURE__ */ jsxs4("tr", { children: [
549
- /* @__PURE__ */ jsx5("th", { className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider w-20", children: "S.No" }),
550
- /* @__PURE__ */ jsx5(
551
- "th",
552
- {
553
- onClick: () => handleSort("name"),
554
- className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider cursor-pointer select-none hover:bg-slate-100 transition-colors",
555
- children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1.5", children: [
556
- "Workflow Name ",
557
- renderSortIcon("name")
558
- ] })
559
- }
560
- ),
561
- /* @__PURE__ */ jsx5(
562
- "th",
563
- {
564
- onClick: () => handleSort("workflowcode"),
565
- className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider cursor-pointer select-none hover:bg-slate-100 transition-colors",
566
- children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1.5", children: [
567
- "Workflow Code ",
568
- renderSortIcon("workflowcode")
569
- ] })
570
- }
571
- ),
572
- /* @__PURE__ */ jsx5(
573
- "th",
574
- {
575
- onClick: () => handleSort("workflowtype"),
576
- className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider cursor-pointer select-none hover:bg-slate-100 transition-colors",
577
- children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1.5", children: [
578
- "Workflow Type ",
579
- renderSortIcon("workflowtype")
580
- ] })
581
- }
582
- ),
583
- /* @__PURE__ */ jsx5(
584
- "th",
585
- {
586
- onClick: () => handleSort("version"),
587
- className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider cursor-pointer select-none hover:bg-slate-100 transition-colors w-24",
588
- children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1.5", children: [
589
- "Version ",
590
- renderSortIcon("version")
591
- ] })
592
- }
593
- ),
594
- /* @__PURE__ */ jsx5("th", { className: "px-6 py-4 text-center text-xs font-bold text-slate-500 uppercase tracking-wider w-32", children: "Published" }),
595
- /* @__PURE__ */ jsx5("th", { className: "px-6 py-4 text-center text-xs font-bold text-slate-500 uppercase tracking-wider w-32", children: "Status" })
625
+ return /* @__PURE__ */ jsxs7("div", { className: "space-y-5", children: [
626
+ /* @__PURE__ */ jsx7("div", { className: "w-full overflow-x-auto border border-slate-200 rounded-2xl shadow-sm max-h-[420px] overflow-y-auto", children: /* @__PURE__ */ jsxs7("table", { className: "w-full text-left border-collapse bg-white table-auto", children: [
627
+ /* @__PURE__ */ jsx7("thead", { className: "sticky top-0 z-10 bg-slate-50 shadow-[0_1px_0_0_rgba(226,232,240,1)]", children: /* @__PURE__ */ jsxs7("tr", { className: "text-xs font-bold uppercase tracking-wider text-slate-500", children: [
628
+ /* @__PURE__ */ jsx7("th", { className: "py-4 px-4 w-16 text-center bg-slate-50", children: "S.NO" }),
629
+ /* @__PURE__ */ jsxs7("th", { onClick: () => handleSort("workflowName"), className: "py-4 px-5 text-sm cursor-pointer select-none hover:text-slate-900 bg-slate-50 whitespace-nowrap", children: [
630
+ "WORKFLOW NAME ",
631
+ sortKey === "workflowName" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
632
+ ] }),
633
+ /* @__PURE__ */ jsxs7("th", { onClick: () => handleSort("workflowCode"), className: "py-4 px-5 text-sm cursor-pointer select-none hover:text-slate-900 bg-slate-50 whitespace-nowrap", children: [
634
+ "WORKFLOW CODE ",
635
+ sortKey === "workflowCode" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
636
+ ] }),
637
+ /* @__PURE__ */ jsxs7("th", { onClick: () => handleSort("workflowType"), className: "py-4 px-5 text-sm cursor-pointer select-none hover:text-slate-900 bg-slate-50 whitespace-nowrap", children: [
638
+ "WORKFLOW TYPE ",
639
+ sortKey === "workflowType" ? sortOrder === "asc" ? "\u25B2" : "\u25BC" : "\u25B2"
640
+ ] }),
641
+ /* @__PURE__ */ jsx7("th", { className: "py-4 px-5 text-sm bg-slate-50 whitespace-nowrap text-center", children: "VERSION" }),
642
+ /* @__PURE__ */ jsx7("th", { className: "py-4 px-5 text-sm bg-slate-50 whitespace-nowrap text-center", children: "PUBLISHED" }),
643
+ /* @__PURE__ */ jsx7("th", { className: "py-4 px-5 text-sm bg-slate-50 text-center whitespace-nowrap", children: "STATUS" })
596
644
  ] }) }),
597
- /* @__PURE__ */ jsx5("tbody", { className: "divide-y divide-slate-100", children: currentDisplayedWorkflows.length === 0 ? /* @__PURE__ */ jsx5("tr", { children: /* @__PURE__ */ jsx5("td", { colSpan: 7, className: "px-6 py-12 text-center text-sm font-medium text-slate-400 bg-white", children: "No workflows found matching your criteria." }) }) : currentDisplayedWorkflows.map((workflow, index) => /* @__PURE__ */ jsxs4("tr", { className: "hover:bg-slate-50/50 transition", children: [
598
- /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-sm text-slate-400 font-medium", children: indexOfFirstEntry + index + 1 }),
599
- /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-sm font-semibold text-slate-800", children: workflow.name }),
600
- /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-sm text-slate-500 font-medium", children: workflow.workflowcode }),
601
- /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-sm text-slate-500 font-medium", children: workflow.workflowtype }),
602
- /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-sm text-slate-800 font-bold", children: workflow.version }),
603
- /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-center", children: (() => {
604
- var _a;
605
- const isPublished = ((_a = workflow == null ? void 0 : workflow.published) == null ? void 0 : _a.toString().toLowerCase()) === "yes" || (workflow == null ? void 0 : workflow.published) === true;
606
- return /* @__PURE__ */ jsx5("span", { className: `inline-flex items-center gap-1 px-2.5 py-1 rounded-md text-xs font-semibold ${isPublished ? "bg-emerald-50 text-emerald-600 border border-emerald-200/50" : "bg-rose-50 text-rose-600 border border-rose-200/50"}`, children: isPublished ? "\u2713 Yes" : "\u2715 No" });
607
- })() }),
608
- /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-center", children: /* @__PURE__ */ jsx5("div", { className: "flex justify-center items-center", children: /* @__PURE__ */ jsxs4("label", { className: "relative inline-flex items-center cursor-pointer group", children: [
609
- /* @__PURE__ */ jsx5(
610
- "input",
611
- {
612
- type: "checkbox",
613
- checked: workflow.status || false,
614
- onChange: () => workflowtoggle && workflowtoggle(workflow.id),
615
- className: "sr-only peer"
616
- }
617
- ),
618
- /* @__PURE__ */ jsx5("div", { className: "w-10 h-6 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[4px] after:start-[4px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-blue-600 group-hover:scale-105 transition-transform" })
619
- ] }) }) })
620
- ] }, workflow.id)) })
621
- ] }) }),
622
- /* @__PURE__ */ jsx5("div", { className: "bg-[#fcfdfe] border border-slate-100 rounded-2xl px-6 py-4 flex items-center justify-end gap-6 shadow-sm", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1", children: [
623
- /* @__PURE__ */ jsx5(
624
- "button",
625
- {
626
- onClick: () => setCurrentPage(1),
627
- disabled: activePage === 1,
628
- className: `px-3 py-1.5 text-xs font-semibold rounded-lg transition ${activePage === 1 ? "text-slate-300 cursor-not-allowed" : "text-slate-500 hover:bg-slate-50 cursor-pointer"}`,
629
- children: "First"
630
- }
631
- ),
632
- /* @__PURE__ */ jsx5(
633
- "button",
634
- {
635
- onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)),
636
- disabled: activePage === 1,
637
- className: `px-3 py-1.5 text-xs font-semibold rounded-lg transition flex items-center gap-1 ${activePage === 1 ? "text-slate-300 cursor-not-allowed" : "text-slate-500 hover:bg-slate-50 cursor-pointer"}`,
638
- children: "\u2039 Prev"
639
- }
640
- ),
641
- Array.from({ length: totalPages }, (_, index) => {
642
- const pageNum = index + 1;
643
- return /* @__PURE__ */ jsx5(
645
+ /* @__PURE__ */ jsx7("tbody", { className: "divide-y divide-slate-100 text-sm text-slate-600", children: visibleData.map((item, index) => /* @__PURE__ */ jsxs7("tr", { className: "hover:bg-slate-50/50 transition-colors", children: [
646
+ /* @__PURE__ */ jsx7("td", { className: "py-4 px-4 text-center font-medium text-slate-400", children: startIndex + index + 1 }),
647
+ /* @__PURE__ */ jsx7("td", { className: "py-4 px-5 font-bold text-slate-900 text-[14px] whitespace-nowrap", children: item.workflowName }),
648
+ /* @__PURE__ */ jsx7("td", { className: "py-4 px-5 text-slate-500 font-mono text-xs whitespace-nowrap", children: item.workflowCode }),
649
+ /* @__PURE__ */ jsx7("td", { className: "py-4 px-5 text-slate-600 font-medium whitespace-nowrap", children: item.workflowType }),
650
+ /* @__PURE__ */ jsx7("td", { className: "py-4 px-5 font-bold text-slate-800 text-center whitespace-nowrap", children: item.version }),
651
+ /* @__PURE__ */ jsx7("td", { className: "py-4 px-5 text-center whitespace-nowrap", children: /* @__PURE__ */ jsx7("span", { className: `px-2 py-0.5 text-xs font-semibold rounded ${item.published ? "bg-emerald-50 text-emerald-600 border border-emerald-200" : "bg-rose-50 text-rose-600 border border-rose-200"}`, children: item.published ? "\u2713 Yes" : "\u2715 No" }) }),
652
+ /* @__PURE__ */ jsx7("td", { className: "py-4 px-5 text-center whitespace-nowrap", children: /* @__PURE__ */ jsx7(
644
653
  "button",
645
654
  {
646
- onClick: () => setCurrentPage(pageNum),
647
- className: `w-8 h-8 text-xs font-bold rounded-lg transition ${activePage === pageNum ? "bg-[#1e60ff] text-white shadow-sm shadow-blue-500/20" : "text-slate-500 hover:bg-slate-50 cursor-pointer"}`,
648
- children: pageNum
649
- },
650
- pageNum
651
- );
652
- }),
653
- /* @__PURE__ */ jsx5(
654
- "button",
655
- {
656
- onClick: () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)),
657
- disabled: activePage === totalPages,
658
- className: `px-3 py-1.5 text-xs font-semibold rounded-lg transition flex items-center gap-1 ${activePage === totalPages ? "text-slate-300 cursor-not-allowed" : "text-slate-500 hover:bg-slate-50 cursor-pointer"}`,
659
- children: "Next \u203A"
660
- }
661
- ),
662
- /* @__PURE__ */ jsx5(
655
+ onClick: () => toggleStatus(item.id),
656
+ className: `relative inline-flex h-5.5 w-10 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out outline-none ${item.status ? "bg-blue-600" : "bg-slate-200"}`,
657
+ children: /* @__PURE__ */ jsx7("span", { className: `pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${item.status ? "translate-x-4.5" : "translate-x-0"}` })
658
+ }
659
+ ) })
660
+ ] }, item.id)) })
661
+ ] }) }),
662
+ /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-end gap-1 text-[13px] text-slate-700 font-normal mt-4 bg-slate-50/50 p-3 rounded-xl border border-slate-100", children: [
663
+ /* @__PURE__ */ jsx7("button", { onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)), disabled: currentPage === 1, className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 mr-2 disabled:opacity-40", children: "\u2039 Prev" }),
664
+ pageNumbers.map((pageNumber) => /* @__PURE__ */ jsx7(
663
665
  "button",
664
666
  {
665
- onClick: () => setCurrentPage(totalPages),
666
- disabled: activePage === totalPages,
667
- className: `px-3 py-1.5 text-xs font-semibold rounded-lg transition ${activePage === totalPages ? "text-slate-300 cursor-not-allowed" : "text-slate-500 hover:bg-slate-50 cursor-pointer"}`,
668
- children: "Last"
669
- }
670
- )
671
- ] }) })
667
+ onClick: () => setCurrentPage(pageNumber),
668
+ className: `px-3 py-1 text-center rounded transition-all min-w-[28px] ${currentPage === pageNumber ? "bg-blue-600 text-white font-medium shadow-sm" : "text-slate-600 hover:bg-slate-100"}`,
669
+ children: pageNumber
670
+ },
671
+ pageNumber
672
+ )),
673
+ /* @__PURE__ */ jsx7("button", { onClick: () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)), disabled: currentPage === totalPages, className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 ml-2 disabled:opacity-40", children: "Next \u203A" })
674
+ ] })
672
675
  ] });
673
676
  }
674
677
 
675
- // src/components/workflowMaster/workFlowMasterMain.js
676
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
677
- function WorkflowMasterMain() {
678
- const [search, setSearch] = useState3("");
679
- const [entriesPerPage, setEntriesPerPage] = useState3(10);
680
- const [isModalOpen, setIsModalOpen] = useState3(false);
681
- const [newWorkflow, setNewWorkflow] = useState3({
682
- name: "",
683
- workflowcode: "",
684
- workflowtype: "",
685
- version: "1",
686
- published: "No",
687
- description: ""
688
- });
689
- const [workflows, setWorkflows] = useState3([
690
- {
691
- id: 1,
692
- name: "Trade License Workflow",
693
- workflowcode: "TRD-001",
694
- workflowtype: "Trade License",
695
- version: "1",
696
- published: "Yes",
697
- status: true
698
- },
699
- {
700
- id: 2,
701
- name: "Citizen Petition Workflow",
702
- workflowcode: "PET-001",
703
- workflowtype: "Petition",
704
- version: "1",
705
- published: "Yes",
706
- status: true
707
- },
708
- {
709
- id: 3,
710
- name: "Leave Application Workflow",
711
- workflowcode: "LEV-001",
712
- workflowtype: "Leave",
713
- version: "1",
714
- published: "No",
715
- status: true
716
- },
717
- {
718
- id: 4,
719
- name: "Grievance Redressal Workflow",
720
- workflowcode: "GRV-001",
721
- workflowtype: "Grievance",
722
- version: "2",
723
- published: "Yes",
724
- status: true
725
- },
726
- {
727
- id: 5,
728
- name: "Document Verification",
729
- workflowcode: "DOC-001",
730
- workflowtype: "Verification",
731
- version: "1",
732
- published: "Yes",
733
- status: true
734
- },
735
- {
736
- id: 6,
737
- name: "Building Permission Workflow",
738
- workflowcode: "BLD-001",
739
- workflowtype: "Building Permission",
740
- version: "1",
741
- published: "Yes",
742
- status: true
743
- },
744
- {
745
- id: 7,
746
- name: "Property Tax Assessment",
747
- workflowcode: "PTX-001",
748
- workflowtype: "Property Tax",
749
- version: 1,
750
- published: true,
751
- status: true
752
- },
753
- {
754
- id: 8,
755
- name: "Water Connection Request",
756
- workflowcode: "WTR-001",
757
- workflowtype: "Utility Services",
758
- version: 1,
759
- published: true,
760
- status: true
761
- },
762
- {
763
- id: 9,
764
- name: "Vendor Registration",
765
- workflowcode: "VND-001",
766
- workflowtype: "Procurement",
767
- version: 2,
768
- published: true,
769
- status: false
770
- },
771
- {
772
- id: 10,
773
- name: "No Objection Certificate",
774
- workflowcode: "NOC-001",
775
- workflowtype: "Certification",
776
- version: 1,
777
- published: false,
778
- status: true
779
- },
780
- {
781
- id: 11,
782
- name: "Birth Certificate Application",
783
- workflowcode: "BRT-001",
784
- workflowtype: "Registry",
785
- version: 1,
786
- published: true,
787
- isActive: true
788
- }
789
- ]);
790
- const handleToggle = (id) => {
791
- setWorkflows((prev) => prev.map((w) => w.id === id ? __spreadProps(__spreadValues({}, w), { status: !w.status }) : w));
792
- };
793
- const handleAddWorkflow = (e) => {
794
- e.preventDefault();
795
- if (!newWorkflow.name || !newWorkflow.workflowcode || !newWorkflow.workflowtype) {
796
- alert("Please fill out all fields.");
797
- return;
798
- }
799
- const newId = workflows.length > 0 ? Math.max(...workflows.map((w) => w.id)) + 1 : 1;
800
- const addedItem = {
801
- id: newId,
802
- name: newWorkflow.name,
803
- workflowcode: newWorkflow.workflowcode,
804
- workflowtype: newWorkflow.workflowtype,
805
- version: newWorkflow.version || "1",
806
- published: newWorkflow.published,
807
- status: true
808
- };
809
- setWorkflows([addedItem, ...workflows]);
810
- setNewWorkflow({ name: "", workflowcode: "", workflowtype: "", version: "1", published: "No", description: "" });
811
- setIsModalOpen(false);
812
- };
813
- return /* @__PURE__ */ jsxs5("div", { className: "min-h-screen bg-[#f3f4f6] p-6 font-sans relative", children: [
814
- /* @__PURE__ */ jsxs5("div", { className: "max-w-full mx-auto space-y-5", children: [
815
- /* @__PURE__ */ jsxs5("div", { className: "bg-white rounded-2xl border border-gray-100 shadow-sm p-6 flex justify-between items-center", children: [
816
- /* @__PURE__ */ jsxs5("div", { children: [
817
- /* @__PURE__ */ jsx6("h1", { className: "text-2xl font-bold text-slate-800", children: "Workflow Master" }),
818
- /* @__PURE__ */ jsxs5("nav", { className: "text-xs text-slate-400 mt-1", children: [
819
- "Dashboard > Types > ",
820
- /* @__PURE__ */ jsx6("span", { className: "text-blue-600 font-semibold", children: "Workflow" })
821
- ] })
822
- ] }),
823
- /* @__PURE__ */ jsxs5(
824
- "button",
825
- {
826
- onClick: () => setIsModalOpen(true),
827
- className: "bg-[#1e60ff] hover:bg-blue-700 text-white font-semibold text-sm px-5 py-2.5 rounded-xl transition duration-200 flex items-center gap-1.5 shadow-sm cursor-pointer",
828
- children: [
829
- /* @__PURE__ */ jsx6("span", { className: "text-base font-bold", children: "+" }),
830
- " Add New Workflow"
831
- ]
832
- }
833
- )
834
- ] }),
835
- /* @__PURE__ */ jsxs5("div", { className: "bg-white rounded-2xl border border-gray-100 shadow-sm p-6 space-y-5", children: [
836
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between", children: [
837
- /* @__PURE__ */ jsxs5("div", { className: "relative w-80", children: [
838
- /* @__PURE__ */ jsx6("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3.5 pointer-events-none text-slate-400", children: /* @__PURE__ */ jsx6("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) }),
839
- /* @__PURE__ */ jsx6(
840
- "input",
841
- {
842
- type: "text",
843
- placeholder: "Search workflow name or code...",
844
- value: search,
845
- onChange: (e) => setSearch(e.target.value),
846
- className: "w-full pl-10 pr-4 py-2 text-sm bg-[#fcfdfe] border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 text-slate-700 transition"
847
- }
848
- )
849
- ] }),
850
- /* @__PURE__ */ jsx6("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs5(
851
- "select",
852
- {
853
- value: entriesPerPage,
854
- onChange: (e) => setEntriesPerPage(Number(e.target.value)),
855
- className: "px-4 py-2 text-sm bg-white border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 text-slate-700 cursor-pointer font-medium shadow-sm min-w-[110px]",
856
- children: [
857
- /* @__PURE__ */ jsx6("option", { value: 5, children: "5 Rows" }),
858
- /* @__PURE__ */ jsx6("option", { value: 10, children: "10 Rows" }),
859
- /* @__PURE__ */ jsx6("option", { value: 20, children: "20 Rows" }),
860
- /* @__PURE__ */ jsx6("option", { value: 50, children: "50 Rows" })
861
- ]
862
- }
863
- ) })
864
- ] }),
865
- /* @__PURE__ */ jsx6(
866
- WorkflowTable,
867
- {
868
- search,
869
- workflows,
870
- workflowtoggle: handleToggle,
871
- entriesPerPage,
872
- setEntriesPerPage
873
- }
874
- )
875
- ] })
876
- ] }),
877
- isModalOpen && /* @__PURE__ */ jsx6("div", { className: "fixed inset-0 bg-slate-900/40 backdrop-blur-sm flex justify-center items-center z-50 p-4", children: /* @__PURE__ */ jsxs5("div", { className: "bg-white rounded-[24px] w-full max-w-4xl shadow-2xl border border-slate-100 flex flex-col max-h-[90vh] overflow-hidden animate-in fade-in zoom-in-95 duration-150", children: [
878
- /* @__PURE__ */ jsxs5("div", { className: "px-8 py-5 border-b border-slate-100 flex justify-between items-center", children: [
879
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-4", children: [
880
- /* @__PURE__ */ jsx6("div", { className: "w-11 h-11 bg-indigo-50 border border-indigo-100 rounded-xl flex items-center justify-center text-indigo-600", children: /* @__PURE__ */ jsx6("svg", { className: "w-6 h-6 text-[#5c59eb]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }) }) }),
881
- /* @__PURE__ */ jsxs5("div", { children: [
882
- /* @__PURE__ */ jsx6("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add Workflow" }),
883
- /* @__PURE__ */ jsx6("p", { className: "text-[11px] text-slate-400 font-medium tracking-wide", children: "Create a new workflow and configure its details" })
678
+ // src/components/WorkflowType/AddWorkflowTypeModal.jsx
679
+ import React8 from "react";
680
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
681
+ function AddWorkflowTypeModal({ isOpen, onClose }) {
682
+ if (!isOpen) return null;
683
+ return /* @__PURE__ */ jsxs8("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
684
+ /* @__PURE__ */ jsx8(
685
+ "div",
686
+ {
687
+ className: "fixed inset-0 bg-slate-900/50 backdrop-blur-sm transition-opacity duration-200",
688
+ onClick: onClose
689
+ }
690
+ ),
691
+ /* @__PURE__ */ jsxs8("div", { className: "relative w-full max-w-4xl bg-white rounded-3xl shadow-2xl flex flex-col z-10 max-h-[92vh] overflow-hidden animate-in fade-in zoom-in-95 duration-200", children: [
692
+ /* @__PURE__ */ jsxs8("div", { className: "flex justify-between items-center px-8 py-6 border-b border-slate-100", children: [
693
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-4", children: [
694
+ /* @__PURE__ */ jsx8("div", { className: "w-12 h-12 bg-indigo-50 text-indigo-600 rounded-xl flex items-center justify-center shadow-sm", children: /* @__PURE__ */ jsx8("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }) }) }),
695
+ /* @__PURE__ */ jsxs8("div", { children: [
696
+ /* @__PURE__ */ jsx8("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add Workflow" }),
697
+ /* @__PURE__ */ jsx8("p", { className: "text-xs text-slate-400 mt-0.5", children: "Create a new workflow and configure its details" })
884
698
  ] })
885
699
  ] }),
886
- /* @__PURE__ */ jsx6(
700
+ /* @__PURE__ */ jsx8(
887
701
  "button",
888
702
  {
889
- onClick: () => setIsModalOpen(false),
890
- className: "text-slate-300 hover:text-slate-500 transition cursor-pointer",
891
- children: /* @__PURE__ */ jsx6("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" }) })
703
+ onClick: onClose,
704
+ className: "text-slate-400 hover:text-slate-600 hover:bg-slate-100 p-2 rounded-full transition-all text-sm font-semibold",
705
+ children: "\u2715"
892
706
  }
893
707
  )
894
708
  ] }),
895
- /* @__PURE__ */ jsxs5("form", { onSubmit: handleAddWorkflow, className: "flex-1 overflow-y-auto p-8 space-y-6", children: [
896
- /* @__PURE__ */ jsxs5("div", { className: "border border-slate-100 rounded-2xl p-6 bg-white space-y-5", children: [
897
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 pb-1 border-b border-slate-50", children: [
898
- /* @__PURE__ */ jsx6("span", { className: "text-sm", children: "\u{1F4CB}" }),
899
- /* @__PURE__ */ jsx6("h3", { className: "text-xs font-bold text-[#5c59eb] uppercase tracking-wider", children: "Workflow Information" })
709
+ /* @__PURE__ */ jsxs8("div", { className: "p-8 space-y-8 overflow-y-auto max-h-[calc(92vh-170px)] bg-slate-50/30", children: [
710
+ /* @__PURE__ */ jsxs8("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
711
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
712
+ /* @__PURE__ */ jsx8("span", { children: "\u{1F4CB}" }),
713
+ /* @__PURE__ */ jsx8("span", { children: "Workflow Information" })
900
714
  ] }),
901
- /* @__PURE__ */ jsxs5("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
902
- /* @__PURE__ */ jsxs5("div", { children: [
903
- /* @__PURE__ */ jsxs5("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
715
+ /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
716
+ /* @__PURE__ */ jsxs8("div", { children: [
717
+ /* @__PURE__ */ jsxs8("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
904
718
  "Workflow Type ",
905
- /* @__PURE__ */ jsx6("span", { className: "text-rose-500", children: "*" })
719
+ /* @__PURE__ */ jsx8("span", { className: "text-red-500", children: "*" })
906
720
  ] }),
907
- /* @__PURE__ */ jsxs5(
908
- "select",
909
- {
910
- required: true,
911
- value: newWorkflow.workflowtype,
912
- onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { workflowtype: e.target.value })),
913
- className: "w-full px-4 py-2.5 border border-slate-200 rounded-xl text-sm bg-white text-slate-600 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none transition appearance-none cursor-pointer",
914
- children: [
915
- /* @__PURE__ */ jsx6("option", { value: "", children: "Select workflow type" }),
916
- /* @__PURE__ */ jsx6("option", { value: "Trade License", children: "Trade License" }),
917
- /* @__PURE__ */ jsx6("option", { value: "Petition", children: "Petition" }),
918
- /* @__PURE__ */ jsx6("option", { value: "Leave", children: "Leave" }),
919
- /* @__PURE__ */ jsx6("option", { value: "Grievance", children: "Grievance" }),
920
- /* @__PURE__ */ jsx6("option", { value: "Verification", children: "Verification" })
921
- ]
922
- }
923
- ),
924
- /* @__PURE__ */ jsx6("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Choose the category this workflow belongs to" })
721
+ /* @__PURE__ */ jsxs8("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
722
+ /* @__PURE__ */ jsx8("option", { value: "", children: "Select workflow type" }),
723
+ /* @__PURE__ */ jsx8("option", { value: "petition", children: "Petition" }),
724
+ /* @__PURE__ */ jsx8("option", { value: "building", children: "Building Permission" }),
725
+ /* @__PURE__ */ jsx8("option", { value: "leave", children: "Leave" })
726
+ ] }),
727
+ /* @__PURE__ */ jsx8("p", { className: "text-[10px] text-slate-400 mt-1", children: "Choose the category this workflow belongs to" })
925
728
  ] }),
926
- /* @__PURE__ */ jsxs5("div", { children: [
927
- /* @__PURE__ */ jsxs5("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
729
+ /* @__PURE__ */ jsxs8("div", { children: [
730
+ /* @__PURE__ */ jsxs8("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
928
731
  "Workflow Code ",
929
- /* @__PURE__ */ jsx6("span", { className: "text-rose-500", children: "*" })
732
+ /* @__PURE__ */ jsx8("span", { className: "text-red-500", children: "*" })
930
733
  ] }),
931
- /* @__PURE__ */ jsx6(
734
+ /* @__PURE__ */ jsx8(
932
735
  "input",
933
736
  {
934
737
  type: "text",
935
- required: true,
936
738
  placeholder: "Enter workflow code",
937
- value: newWorkflow.workflowcode,
938
- onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { workflowcode: e.target.value })),
939
- className: "w-full px-4 py-2.5 border border-slate-200 rounded-xl text-sm placeholder-slate-300 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none transition"
739
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
940
740
  }
941
741
  ),
942
- /* @__PURE__ */ jsx6("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Unique code for this workflow (e.g., PET-001)" })
742
+ /* @__PURE__ */ jsx8("p", { className: "text-[10px] text-slate-400 mt-1", children: "Unique code for this workflow (e.g., PET-001)" })
943
743
  ] })
944
744
  ] }),
945
- /* @__PURE__ */ jsxs5("div", { children: [
946
- /* @__PURE__ */ jsxs5("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
745
+ /* @__PURE__ */ jsxs8("div", { children: [
746
+ /* @__PURE__ */ jsxs8("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
947
747
  "Workflow Name ",
948
- /* @__PURE__ */ jsx6("span", { className: "text-rose-500", children: "*" })
748
+ /* @__PURE__ */ jsx8("span", { className: "text-red-500", children: "*" })
949
749
  ] }),
950
- /* @__PURE__ */ jsx6(
750
+ /* @__PURE__ */ jsx8(
951
751
  "input",
952
752
  {
953
753
  type: "text",
954
- required: true,
955
754
  placeholder: "Enter workflow name",
956
- value: newWorkflow.name,
957
- onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { name: e.target.value })),
958
- className: "w-full px-4 py-2.5 border border-slate-200 rounded-xl text-sm placeholder-slate-300 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none transition"
755
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
959
756
  }
960
757
  ),
961
- /* @__PURE__ */ jsx6("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Enter a descriptive name for this workflow" })
758
+ /* @__PURE__ */ jsx8("p", { className: "text-[10px] text-slate-400 mt-1", children: "Enter a descriptive name for this workflow" })
962
759
  ] }),
963
- /* @__PURE__ */ jsxs5("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
964
- /* @__PURE__ */ jsxs5("div", { children: [
965
- /* @__PURE__ */ jsxs5("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
760
+ /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
761
+ /* @__PURE__ */ jsxs8("div", { children: [
762
+ /* @__PURE__ */ jsxs8("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
966
763
  "Version ",
967
- /* @__PURE__ */ jsx6("span", { className: "text-rose-500", children: "*" })
764
+ /* @__PURE__ */ jsx8("span", { className: "text-red-500", children: "*" })
968
765
  ] }),
969
- /* @__PURE__ */ jsx6(
766
+ /* @__PURE__ */ jsx8(
970
767
  "input",
971
768
  {
972
- type: "number",
973
- required: true,
974
- placeholder: "1",
975
- value: newWorkflow.version,
976
- onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { version: e.target.value })),
977
- className: "w-full px-4 py-2.5 border border-slate-200 rounded-xl text-sm placeholder-slate-300 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none transition"
769
+ type: "text",
770
+ defaultValue: "1",
771
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
978
772
  }
979
773
  ),
980
- /* @__PURE__ */ jsx6("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Workflow version number" })
774
+ /* @__PURE__ */ jsx8("p", { className: "text-[10px] text-slate-400 mt-1", children: "Workflow version number" })
981
775
  ] }),
982
- /* @__PURE__ */ jsxs5("div", { children: [
983
- /* @__PURE__ */ jsxs5("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
776
+ /* @__PURE__ */ jsxs8("div", { children: [
777
+ /* @__PURE__ */ jsxs8("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
984
778
  "Published ",
985
- /* @__PURE__ */ jsx6("span", { className: "text-rose-500", children: "*" })
779
+ /* @__PURE__ */ jsx8("span", { className: "text-red-500", children: "*" })
986
780
  ] }),
987
- /* @__PURE__ */ jsxs5(
988
- "select",
989
- {
990
- required: true,
991
- value: newWorkflow.published,
992
- onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { published: e.target.value })),
993
- className: "w-full px-4 py-2.5 border border-slate-200 rounded-xl text-sm bg-white text-slate-600 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none transition appearance-none cursor-pointer",
994
- children: [
995
- /* @__PURE__ */ jsx6("option", { value: "No", children: "No" }),
996
- /* @__PURE__ */ jsx6("option", { value: "Yes", children: "Yes" })
997
- ]
998
- }
999
- ),
1000
- /* @__PURE__ */ jsx6("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Make workflow active for use" })
781
+ /* @__PURE__ */ jsxs8("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
782
+ /* @__PURE__ */ jsx8("option", { value: "false", children: "No" }),
783
+ /* @__PURE__ */ jsx8("option", { value: "true", children: "Yes" })
784
+ ] }),
785
+ /* @__PURE__ */ jsx8("p", { className: "text-[10px] text-slate-400 mt-1", children: "Make workflow active for use" })
1001
786
  ] })
1002
787
  ] })
1003
788
  ] }),
1004
- /* @__PURE__ */ jsxs5("div", { className: "border border-slate-100 rounded-2xl p-6 bg-white space-y-3", children: [
1005
- /* @__PURE__ */ jsxs5("div", { className: "flex justify-between items-center", children: [
1006
- /* @__PURE__ */ jsx6("h3", { className: "text-xs font-bold text-slate-700", children: "Description" }),
1007
- /* @__PURE__ */ jsxs5("span", { className: "text-[10px] text-slate-400", children: [
1008
- newWorkflow.description.length,
1009
- " / 500"
1010
- ] })
789
+ /* @__PURE__ */ jsxs8("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-3", children: [
790
+ /* @__PURE__ */ jsxs8("div", { className: "flex justify-between items-center", children: [
791
+ /* @__PURE__ */ jsx8("label", { className: "block text-xs font-bold text-slate-700", children: "Description" }),
792
+ /* @__PURE__ */ jsx8("span", { className: "text-[10px] text-slate-400", children: "0 / 500" })
1011
793
  ] }),
1012
- /* @__PURE__ */ jsx6(
794
+ /* @__PURE__ */ jsx8(
1013
795
  "textarea",
1014
796
  {
1015
- rows: "3",
1016
- maxLength: "500",
1017
- placeholder: "Enter description here...",
1018
- value: newWorkflow.description,
1019
- onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { description: e.target.value })),
1020
- className: "w-full px-4 py-2.5 border border-slate-200 rounded-xl text-sm placeholder-slate-300 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none transition resize-none"
1021
- }
1022
- )
1023
- ] }),
1024
- /* @__PURE__ */ jsxs5("div", { className: "flex gap-3 justify-end pt-4 border-t border-slate-50", children: [
1025
- /* @__PURE__ */ jsxs5(
1026
- "button",
1027
- {
1028
- type: "button",
1029
- onClick: () => setIsModalOpen(false),
1030
- className: "px-6 py-2.5 text-xs font-bold text-slate-500 hover:bg-slate-50 border border-slate-200 rounded-xl transition flex items-center gap-1.5 cursor-pointer",
1031
- children: [
1032
- /* @__PURE__ */ jsx6("span", { children: "\u2715" }),
1033
- " Cancel"
1034
- ]
797
+ rows: 3,
798
+ placeholder: "Enter workflow description (optional)",
799
+ className: "w-full p-3 border border-slate-200 rounded-xl text-xs resize-none focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1035
800
  }
1036
801
  ),
1037
- /* @__PURE__ */ jsxs5(
1038
- "button",
1039
- {
1040
- type: "submit",
1041
- className: "px-6 py-2.5 text-xs font-bold text-white bg-[#5c59eb] hover:bg-indigo-700 rounded-xl transition flex items-center gap-1.5 shadow-sm cursor-pointer",
1042
- children: [
1043
- /* @__PURE__ */ jsx6("span", { children: "\u{1F4BE}" }),
1044
- " Save Workflow"
1045
- ]
1046
- }
1047
- )
1048
- ] })
1049
- ] })
1050
- ] }) })
1051
- ] });
1052
- }
1053
-
1054
- // src/components/WorkflowType/WorkflowTypeMains.js
1055
- import React8, { useState as useState5 } from "react";
1056
-
1057
- // src/components/WorkflowType/SearchBar.jsx
1058
- import React4 from "react";
1059
- import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
1060
- function SearchBar() {
1061
- return /* @__PURE__ */ jsxs6("div", { className: "relative max-w-sm w-full", children: [
1062
- /* @__PURE__ */ jsx7("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3.5 pointer-events-none", children: /* @__PURE__ */ jsx7("svg", { className: "w-4.5 h-4.5 text-slate-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx7("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) }),
1063
- /* @__PURE__ */ jsx7(
1064
- "input",
1065
- {
1066
- type: "text",
1067
- placeholder: "Search workflow name or code...",
1068
- className: "w-full pl-10 pr-4 py-2.5 border border-slate-200 rounded-xl text-sm bg-slate-50/50 focus:outline-none focus:ring-4 focus:ring-blue-500/10 focus:border-blue-500 text-slate-700 placeholder-slate-400 transition-all shadow-sm"
1069
- }
1070
- )
1071
- ] });
1072
- }
1073
-
1074
- // src/components/WorkflowType/WorkflowTypeTable.jsx
1075
- import React5, { useState as useState4 } from "react";
1076
- import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
1077
- function WorkflowTypeTable({ pageSize }) {
1078
- const initialData = [
1079
- { id: "1", name: "Citizen Petition Workflow", code: "PET-001", type: "Petition", version: "1", published: true, status: true },
1080
- { id: "2", name: "Building Permission Workflow", code: "BLD-001", type: "Building Permission", version: "1", published: true, status: true },
1081
- { id: "3", name: "Leave Application Workflow", code: "LEV-001", type: "Leave", version: "1", published: false, status: true },
1082
- { id: "4", name: "Grievance Redressal Workflow", code: "GRV-001", type: "Grievance", version: "2", published: true, status: true },
1083
- { id: "5", name: "Trade License Workflow", code: "TRD-001", type: "Trade License", version: "1", published: true, status: true },
1084
- { id: "6", name: "Document Verification", code: "DOC-001", type: "Verification", version: "1", published: true, status: true }
1085
- ];
1086
- const [data, setData] = useState4(initialData);
1087
- const [sortOrder, setSortOrder] = useState4("asc");
1088
- const [currentPage, setCurrentPage] = useState4(1);
1089
- const totalPages = Math.ceil(data.length / pageSize) || 1;
1090
- const startIndex = (currentPage - 1) * pageSize;
1091
- const visibleData = data.slice(startIndex, startIndex + pageSize);
1092
- const handleSort = (columnKey) => {
1093
- const isAsc = sortOrder === "asc";
1094
- setSortOrder(isAsc ? "desc" : "asc");
1095
- const sortedData = [...data].sort((a, b) => {
1096
- if (a[columnKey] < b[columnKey]) return isAsc ? -1 : 1;
1097
- if (a[columnKey] > b[columnKey]) return isAsc ? 1 : -1;
1098
- return 0;
1099
- });
1100
- setData(sortedData);
1101
- };
1102
- const toggleSwitch = (id) => {
1103
- const updatedData = data.map(
1104
- (item) => item.id === id ? __spreadProps(__spreadValues({}, item), { status: !item.status }) : item
1105
- );
1106
- setData(updatedData);
1107
- };
1108
- return /* @__PURE__ */ jsxs7("div", { className: "space-y-5", children: [
1109
- /* @__PURE__ */ jsx8("div", { className: "w-full overflow-x-auto border border-slate-200 rounded-2xl shadow-sm", children: /* @__PURE__ */ jsxs7("table", { className: "w-full text-left border-collapse bg-white", children: [
1110
- /* @__PURE__ */ jsx8("thead", { children: /* @__PURE__ */ jsxs7("tr", { className: "bg-slate-50/70 border-b border-slate-200 text-xs font-bold uppercase tracking-wider text-slate-500", children: [
1111
- /* @__PURE__ */ jsx8("th", { className: "py-4.5 px-5 w-20 text-center", children: "S.No" }),
1112
- /* @__PURE__ */ jsxs7("th", { onClick: () => handleSort("name"), className: "py-4.5 px-5 text-sm cursor-pointer select-none hover:text-slate-900", children: [
1113
- "Workflow Name ",
1114
- sortOrder === "asc" ? "\u25B2" : "\u25BC"
1115
- ] }),
1116
- /* @__PURE__ */ jsxs7("th", { onClick: () => handleSort("code"), className: "py-4.5 px-5 cursor-pointer select-none hover:text-slate-900", children: [
1117
- "Workflow Code ",
1118
- sortOrder === "asc" ? "\u25B2" : "\u25BC"
1119
- ] }),
1120
- /* @__PURE__ */ jsxs7("th", { onClick: () => handleSort("type"), className: "py-4.5 px-5 cursor-pointer select-none hover:text-slate-900", children: [
1121
- "Workflow Type ",
1122
- sortOrder === "asc" ? "\u25B2" : "\u25BC"
1123
- ] }),
1124
- /* @__PURE__ */ jsx8("th", { className: "py-4.5 px-5 text-center", children: "Version" }),
1125
- /* @__PURE__ */ jsx8("th", { className: "py-4.5 px-5 text-center", children: "Published" }),
1126
- /* @__PURE__ */ jsx8("th", { className: "py-4.5 px-5 text-center", children: "Status" })
1127
- ] }) }),
1128
- /* @__PURE__ */ jsx8("tbody", { className: "divide-y divide-slate-100 text-sm text-slate-600", children: visibleData.map((item, index) => /* @__PURE__ */ jsxs7("tr", { className: "hover:bg-slate-50/50 transition-colors", children: [
1129
- /* @__PURE__ */ jsx8("td", { className: "py-4 px-5 text-center font-medium text-slate-400", children: startIndex + index + 1 }),
1130
- /* @__PURE__ */ jsx8("td", { className: "py-4 px-5 font-bold text-slate-900 text-[14px]", children: item.name }),
1131
- /* @__PURE__ */ jsx8("td", { className: "py-4 px-5 text-slate-500", children: item.code }),
1132
- /* @__PURE__ */ jsx8("td", { className: "py-4 px-5 text-slate-500", children: item.type }),
1133
- /* @__PURE__ */ jsx8("td", { className: "py-4 px-5 text-center font-semibold text-slate-700", children: item.version }),
1134
- /* @__PURE__ */ jsx8("td", { className: "py-4 px-5 text-center", children: /* @__PURE__ */ jsx8("span", { className: `px-2.5 py-1 rounded-md text-xs font-medium ${item.published ? "bg-green-50 text-green-700 border border-green-200" : "bg-red-50 text-red-700 border border-red-200"}`, children: item.published ? "\u2713 Yes" : "\u2715 No" }) }),
1135
- /* @__PURE__ */ jsx8("td", { className: "py-4 px-5 text-center", children: /* @__PURE__ */ jsx8("div", { className: "flex justify-center items-center", children: /* @__PURE__ */ jsx8(
1136
- "button",
1137
- {
1138
- type: "button",
1139
- onClick: () => toggleSwitch(item.id),
1140
- className: `relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out outline-none ${item.status ? "bg-blue-600" : "bg-slate-200"}`,
1141
- children: /* @__PURE__ */ jsx8(
1142
- "span",
1143
- {
1144
- className: `pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${item.status ? "translate-x-5" : "translate-x-0"}`
1145
- }
1146
- )
1147
- }
1148
- ) }) })
1149
- ] }, item.id)) })
1150
- ] }) }),
1151
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-end gap-1 text-[13px] text-slate-700 font-normal mt-4 bg-slate-50/50 p-3 rounded-xl border border-slate-100", children: [
1152
- /* @__PURE__ */ jsx8(
1153
- "button",
1154
- {
1155
- onClick: () => setCurrentPage(1),
1156
- className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors",
1157
- children: "First"
1158
- }
1159
- ),
1160
- /* @__PURE__ */ jsx8(
1161
- "button",
1162
- {
1163
- onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)),
1164
- className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors mr-2",
1165
- children: "\u2039 Prev"
1166
- }
1167
- ),
1168
- [1, 2, 3, 4].map((pageNumber) => /* @__PURE__ */ jsx8(
1169
- "button",
1170
- {
1171
- onClick: () => setCurrentPage(pageNumber),
1172
- className: `px-3 py-1 text-center rounded transition-all min-w-[28px] ${currentPage === pageNumber ? "bg-blue-600 text-white font-medium shadow-sm" : "text-slate-600 hover:bg-slate-100"}`,
1173
- children: pageNumber
1174
- },
1175
- pageNumber
1176
- )),
1177
- /* @__PURE__ */ jsx8(
1178
- "button",
1179
- {
1180
- onClick: () => setCurrentPage((prev) => Math.min(prev + 1, 7)),
1181
- className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors ml-2",
1182
- children: "Next \u203A"
1183
- }
1184
- ),
1185
- /* @__PURE__ */ jsx8(
1186
- "button",
1187
- {
1188
- onClick: () => setCurrentPage(7),
1189
- className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors",
1190
- children: "Last"
1191
- }
1192
- )
1193
- ] })
1194
- ] });
1195
- }
1196
-
1197
- // src/components/WorkflowType/AddWorkflowTypeModal.jsx
1198
- import React6 from "react";
1199
- import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1200
- function AddWorkflowTypeModal({ isOpen, onClose }) {
1201
- if (!isOpen) return null;
1202
- return /* @__PURE__ */ jsxs8("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1203
- /* @__PURE__ */ jsx9(
1204
- "div",
1205
- {
1206
- className: "fixed inset-0 bg-slate-900/50 backdrop-blur-sm transition-opacity duration-200",
1207
- onClick: onClose
1208
- }
1209
- ),
1210
- /* @__PURE__ */ jsxs8("div", { className: "relative w-full max-w-4xl bg-white rounded-3xl shadow-2xl flex flex-col z-10 max-h-[92vh] overflow-hidden animate-in fade-in zoom-in-95 duration-200", children: [
1211
- /* @__PURE__ */ jsxs8("div", { className: "flex justify-between items-center px-8 py-6 border-b border-slate-100", children: [
1212
- /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-4", children: [
1213
- /* @__PURE__ */ jsx9("div", { className: "w-12 h-12 bg-indigo-50 text-indigo-600 rounded-xl flex items-center justify-center shadow-sm", children: /* @__PURE__ */ jsx9("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx9("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }) }) }),
1214
- /* @__PURE__ */ jsxs8("div", { children: [
1215
- /* @__PURE__ */ jsx9("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add Workflow" }),
1216
- /* @__PURE__ */ jsx9("p", { className: "text-xs text-slate-400 mt-0.5", children: "Create a new workflow and configure its details" })
1217
- ] })
1218
- ] }),
1219
- /* @__PURE__ */ jsx9(
1220
- "button",
1221
- {
1222
- onClick: onClose,
1223
- className: "text-slate-400 hover:text-slate-600 hover:bg-slate-100 p-2 rounded-full transition-all text-sm font-semibold",
1224
- children: "\u2715"
1225
- }
1226
- )
1227
- ] }),
1228
- /* @__PURE__ */ jsxs8("div", { className: "p-8 space-y-8 overflow-y-auto max-h-[calc(92vh-170px)] bg-slate-50/30", children: [
1229
- /* @__PURE__ */ jsxs8("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1230
- /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1231
- /* @__PURE__ */ jsx9("span", { children: "\u{1F4CB}" }),
1232
- /* @__PURE__ */ jsx9("span", { children: "Workflow Information" })
1233
- ] }),
1234
- /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1235
- /* @__PURE__ */ jsxs8("div", { children: [
1236
- /* @__PURE__ */ jsxs8("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1237
- "Workflow Type ",
1238
- /* @__PURE__ */ jsx9("span", { className: "text-red-500", children: "*" })
1239
- ] }),
1240
- /* @__PURE__ */ jsxs8("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1241
- /* @__PURE__ */ jsx9("option", { value: "", children: "Select workflow type" }),
1242
- /* @__PURE__ */ jsx9("option", { value: "petition", children: "Petition" }),
1243
- /* @__PURE__ */ jsx9("option", { value: "building", children: "Building Permission" }),
1244
- /* @__PURE__ */ jsx9("option", { value: "leave", children: "Leave" })
1245
- ] }),
1246
- /* @__PURE__ */ jsx9("p", { className: "text-[10px] text-slate-400 mt-1", children: "Choose the category this workflow belongs to" })
1247
- ] }),
1248
- /* @__PURE__ */ jsxs8("div", { children: [
1249
- /* @__PURE__ */ jsxs8("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1250
- "Workflow Code ",
1251
- /* @__PURE__ */ jsx9("span", { className: "text-red-500", children: "*" })
1252
- ] }),
1253
- /* @__PURE__ */ jsx9(
1254
- "input",
1255
- {
1256
- type: "text",
1257
- placeholder: "Enter workflow code",
1258
- className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1259
- }
1260
- ),
1261
- /* @__PURE__ */ jsx9("p", { className: "text-[10px] text-slate-400 mt-1", children: "Unique code for this workflow (e.g., PET-001)" })
1262
- ] })
1263
- ] }),
1264
- /* @__PURE__ */ jsxs8("div", { children: [
1265
- /* @__PURE__ */ jsxs8("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1266
- "Workflow Name ",
1267
- /* @__PURE__ */ jsx9("span", { className: "text-red-500", children: "*" })
1268
- ] }),
1269
- /* @__PURE__ */ jsx9(
1270
- "input",
1271
- {
1272
- type: "text",
1273
- placeholder: "Enter workflow name",
1274
- className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1275
- }
1276
- ),
1277
- /* @__PURE__ */ jsx9("p", { className: "text-[10px] text-slate-400 mt-1", children: "Enter a descriptive name for this workflow" })
1278
- ] }),
1279
- /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1280
- /* @__PURE__ */ jsxs8("div", { children: [
1281
- /* @__PURE__ */ jsxs8("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1282
- "Version ",
1283
- /* @__PURE__ */ jsx9("span", { className: "text-red-500", children: "*" })
1284
- ] }),
1285
- /* @__PURE__ */ jsx9(
1286
- "input",
1287
- {
1288
- type: "text",
1289
- defaultValue: "1",
1290
- className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1291
- }
1292
- ),
1293
- /* @__PURE__ */ jsx9("p", { className: "text-[10px] text-slate-400 mt-1", children: "Workflow version number" })
1294
- ] }),
1295
- /* @__PURE__ */ jsxs8("div", { children: [
1296
- /* @__PURE__ */ jsxs8("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1297
- "Published ",
1298
- /* @__PURE__ */ jsx9("span", { className: "text-red-500", children: "*" })
1299
- ] }),
1300
- /* @__PURE__ */ jsxs8("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1301
- /* @__PURE__ */ jsx9("option", { value: "false", children: "No" }),
1302
- /* @__PURE__ */ jsx9("option", { value: "true", children: "Yes" })
1303
- ] }),
1304
- /* @__PURE__ */ jsx9("p", { className: "text-[10px] text-slate-400 mt-1", children: "Make workflow active for use" })
1305
- ] })
1306
- ] })
1307
- ] }),
1308
- /* @__PURE__ */ jsxs8("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-3", children: [
1309
- /* @__PURE__ */ jsxs8("div", { className: "flex justify-between items-center", children: [
1310
- /* @__PURE__ */ jsx9("label", { className: "block text-xs font-bold text-slate-700", children: "Description" }),
1311
- /* @__PURE__ */ jsx9("span", { className: "text-[10px] text-slate-400", children: "0 / 500" })
1312
- ] }),
1313
- /* @__PURE__ */ jsx9(
1314
- "textarea",
1315
- {
1316
- rows: 3,
1317
- placeholder: "Enter workflow description (optional)",
1318
- className: "w-full p-3 border border-slate-200 rounded-xl text-xs resize-none focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1319
- }
1320
- ),
1321
- /* @__PURE__ */ jsx9("p", { className: "text-[10px] text-slate-400", children: "Provide additional information about this workflow" })
802
+ /* @__PURE__ */ jsx8("p", { className: "text-[10px] text-slate-400", children: "Provide additional information about this workflow" })
1322
803
  ] }),
1323
804
  /* @__PURE__ */ jsxs8("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1324
805
  /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1325
- /* @__PURE__ */ jsx9("span", { children: "\u2699\uFE0F" }),
1326
- /* @__PURE__ */ jsx9("span", { children: "Status & Settings" })
806
+ /* @__PURE__ */ jsx8("span", { children: "\u2699\uFE0F" }),
807
+ /* @__PURE__ */ jsx8("span", { children: "Status & Settings" })
1327
808
  ] }),
1328
809
  /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1329
810
  /* @__PURE__ */ jsxs8("div", { children: [
1330
811
  /* @__PURE__ */ jsxs8("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1331
812
  "Status ",
1332
- /* @__PURE__ */ jsx9("span", { className: "text-red-500", children: "*" })
813
+ /* @__PURE__ */ jsx8("span", { className: "text-red-500", children: "*" })
1333
814
  ] }),
1334
815
  /* @__PURE__ */ jsxs8("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1335
- /* @__PURE__ */ jsx9("option", { value: "active", children: "Active" }),
1336
- /* @__PURE__ */ jsx9("option", { value: "inactive", children: "Inactive" })
816
+ /* @__PURE__ */ jsx8("option", { value: "active", children: "Active" }),
817
+ /* @__PURE__ */ jsx8("option", { value: "inactive", children: "Inactive" })
1337
818
  ] }),
1338
- /* @__PURE__ */ jsx9("p", { className: "text-[10px] text-slate-400 mt-1", children: "Set the initial status of this workflow" })
819
+ /* @__PURE__ */ jsx8("p", { className: "text-[10px] text-slate-400 mt-1", children: "Set the initial status of this workflow" })
1339
820
  ] }),
1340
821
  /* @__PURE__ */ jsxs8("div", { children: [
1341
- /* @__PURE__ */ jsx9("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: "Default Priority" }),
822
+ /* @__PURE__ */ jsx8("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: "Default Priority" }),
1342
823
  /* @__PURE__ */ jsxs8("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1343
- /* @__PURE__ */ jsx9("option", { value: "medium", children: "Medium" }),
1344
- /* @__PURE__ */ jsx9("option", { value: "high", children: "High" }),
1345
- /* @__PURE__ */ jsx9("option", { value: "low", children: "Low" })
824
+ /* @__PURE__ */ jsx8("option", { value: "medium", children: "Medium" }),
825
+ /* @__PURE__ */ jsx8("option", { value: "high", children: "High" }),
826
+ /* @__PURE__ */ jsx8("option", { value: "low", children: "Low" })
1346
827
  ] }),
1347
- /* @__PURE__ */ jsx9("p", { className: "text-[10px] text-slate-400 mt-1", children: "Default priority for tasks in this workflow" })
828
+ /* @__PURE__ */ jsx8("p", { className: "text-[10px] text-slate-400 mt-1", children: "Default priority for tasks in this workflow" })
1348
829
  ] })
1349
830
  ] })
1350
831
  ] }),
1351
832
  /* @__PURE__ */ jsxs8("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1352
833
  /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1353
- /* @__PURE__ */ jsx9("span", { children: "\u{1F6E0}\uFE0F" }),
1354
- /* @__PURE__ */ jsx9("span", { children: "Additional Settings" })
834
+ /* @__PURE__ */ jsx8("span", { children: "\u{1F6E0}\uFE0F" }),
835
+ /* @__PURE__ */ jsx8("span", { children: "Additional Settings" })
1355
836
  ] }),
1356
837
  /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
1357
838
  /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1358
839
  /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3", children: [
1359
- /* @__PURE__ */ jsx9("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u23F1\uFE0F" }),
840
+ /* @__PURE__ */ jsx8("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u23F1\uFE0F" }),
1360
841
  /* @__PURE__ */ jsxs8("div", { children: [
1361
- /* @__PURE__ */ jsx9("p", { className: "text-xs font-bold text-slate-700", children: "Enable SLA" }),
1362
- /* @__PURE__ */ jsx9("p", { className: "text-[9px] text-slate-400", children: "Enable SLA for workflow" })
842
+ /* @__PURE__ */ jsx8("p", { className: "text-xs font-bold text-slate-700", children: "Enable SLA" }),
843
+ /* @__PURE__ */ jsx8("p", { className: "text-[9px] text-slate-400", children: "Enable SLA for workflow" })
1363
844
  ] })
1364
845
  ] }),
1365
846
  /* @__PURE__ */ jsxs8("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1366
- /* @__PURE__ */ jsx9("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1367
- /* @__PURE__ */ jsx9("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
847
+ /* @__PURE__ */ jsx8("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
848
+ /* @__PURE__ */ jsx8("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1368
849
  ] })
1369
850
  ] }),
1370
851
  /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1371
852
  /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3", children: [
1372
- /* @__PURE__ */ jsx9("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F504}" }),
853
+ /* @__PURE__ */ jsx8("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F504}" }),
1373
854
  /* @__PURE__ */ jsxs8("div", { children: [
1374
- /* @__PURE__ */ jsx9("p", { className: "text-xs font-bold text-slate-700", children: "Allow Rework" }),
1375
- /* @__PURE__ */ jsx9("p", { className: "text-[9px] text-slate-400", children: "Allow files to be sent back" })
855
+ /* @__PURE__ */ jsx8("p", { className: "text-xs font-bold text-slate-700", children: "Allow Rework" }),
856
+ /* @__PURE__ */ jsx8("p", { className: "text-[9px] text-slate-400", children: "Allow files to be sent back" })
1376
857
  ] })
1377
858
  ] }),
1378
859
  /* @__PURE__ */ jsxs8("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1379
- /* @__PURE__ */ jsx9("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1380
- /* @__PURE__ */ jsx9("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
860
+ /* @__PURE__ */ jsx8("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
861
+ /* @__PURE__ */ jsx8("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1381
862
  ] })
1382
863
  ] }),
1383
864
  /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1384
865
  /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3", children: [
1385
- /* @__PURE__ */ jsx9("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F465}" }),
866
+ /* @__PURE__ */ jsx8("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F465}" }),
1386
867
  /* @__PURE__ */ jsxs8("div", { children: [
1387
- /* @__PURE__ */ jsx9("p", { className: "text-xs font-bold text-slate-700", children: "Allow File Delegation" }),
1388
- /* @__PURE__ */ jsx9("p", { className: "text-[9px] text-slate-400", children: "Allow users to delegate tasks" })
868
+ /* @__PURE__ */ jsx8("p", { className: "text-xs font-bold text-slate-700", children: "Allow File Delegation" }),
869
+ /* @__PURE__ */ jsx8("p", { className: "text-[9px] text-slate-400", children: "Allow users to delegate tasks" })
1389
870
  ] })
1390
871
  ] }),
1391
872
  /* @__PURE__ */ jsxs8("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1392
- /* @__PURE__ */ jsx9("input", { type: "checkbox", className: "sr-only peer" }),
1393
- /* @__PURE__ */ jsx9("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
873
+ /* @__PURE__ */ jsx8("input", { type: "checkbox", className: "sr-only peer" }),
874
+ /* @__PURE__ */ jsx8("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1394
875
  ] })
1395
876
  ] })
1396
877
  ] })
1397
878
  ] })
1398
879
  ] }),
1399
880
  /* @__PURE__ */ jsxs8("div", { className: "p-5 bg-white border-t border-slate-100 flex items-center justify-end gap-3 px-8", children: [
1400
- /* @__PURE__ */ jsx9(
881
+ /* @__PURE__ */ jsx8(
1401
882
  "button",
1402
883
  {
1403
884
  onClick: onClose,
@@ -1405,7 +886,7 @@ function AddWorkflowTypeModal({ isOpen, onClose }) {
1405
886
  children: "\u2715 Cancel"
1406
887
  }
1407
888
  ),
1408
- /* @__PURE__ */ jsx9(
889
+ /* @__PURE__ */ jsx8(
1409
890
  "button",
1410
891
  {
1411
892
  type: "button",
@@ -1419,16 +900,16 @@ function AddWorkflowTypeModal({ isOpen, onClose }) {
1419
900
  }
1420
901
 
1421
902
  // src/components/WorkflowType/AddButton.jsx
1422
- import React7 from "react";
1423
- import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
1424
- function AddButton({ onOpen }) {
903
+ import React9 from "react";
904
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
905
+ function AddButton2({ onOpen }) {
1425
906
  return /* @__PURE__ */ jsxs9(
1426
907
  "button",
1427
908
  {
1428
909
  onClick: onOpen,
1429
910
  className: "bg-blue-600 hover:bg-blue-700 text-white px-5 py-2.5 rounded-xl font-bold text-sm shadow-md shadow-blue-500/20 hover:shadow-lg hover:shadow-blue-500/30 transition-all active:scale-95 flex items-center gap-2",
1430
911
  children: [
1431
- /* @__PURE__ */ jsx10("svg", { className: "w-4 h-4 stroke-[2.5]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx10("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) }),
912
+ /* @__PURE__ */ jsx9("svg", { className: "w-4 h-4 stroke-[2.5]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx9("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) }),
1432
913
  "Add Workflow Type"
1433
914
  ]
1434
915
  }
@@ -1436,302 +917,696 @@ function AddButton({ onOpen }) {
1436
917
  }
1437
918
 
1438
919
  // src/components/WorkflowType/WorkflowTypeMains.js
1439
- import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
920
+ import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
1440
921
  function WorkflowTypeMains() {
1441
- const [modalOpen, setModalOpen] = useState5(false);
1442
- const [pageSize, setPageSize] = useState5(10);
922
+ const [modalOpen, setModalOpen] = useState4(false);
923
+ const [pageSize, setPageSize] = useState4(10);
924
+ const [searchQuery, setSearchQuery] = useState4("");
925
+ const [currentPage, setCurrentPage] = useState4(1);
926
+ const [totalEntries, setTotalEntries] = useState4(0);
927
+ const handlePageSizeChange = (e) => {
928
+ setPageSize(Number(e.target.value));
929
+ setCurrentPage(1);
930
+ };
1443
931
  return /* @__PURE__ */ jsxs10("div", { className: "min-h-screen bg-slate-50 p-4 md:p-6", children: [
1444
932
  /* @__PURE__ */ jsxs10("div", { className: "w-full space-y-5", children: [
1445
933
  /* @__PURE__ */ jsxs10("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between bg-white p-6 rounded-2xl border border-slate-200/80 shadow-sm gap-4", children: [
1446
934
  /* @__PURE__ */ jsxs10("div", { children: [
1447
- /* @__PURE__ */ jsx11("h1", { className: "text-2xl font-extrabold text-slate-900 tracking-tight", children: "Workflow Type" }),
935
+ /* @__PURE__ */ jsx10("h1", { className: "text-2xl font-extrabold text-slate-900 tracking-tight", children: "Workflow Type" }),
1448
936
  /* @__PURE__ */ jsxs10("p", { className: "text-xs text-slate-400 mt-1", children: [
1449
937
  "Dashboard > Types > ",
1450
- /* @__PURE__ */ jsx11("span", { className: "text-blue-600 font-semibold", children: "Workflow Type" })
938
+ /* @__PURE__ */ jsx10("span", { className: "text-blue-600 font-semibold", children: "Workflow Type" })
1451
939
  ] })
1452
940
  ] }),
1453
- /* @__PURE__ */ jsx11(AddButton, { onOpen: () => setModalOpen(true) })
941
+ /* @__PURE__ */ jsx10(AddButton2, { onOpen: () => setModalOpen(true) })
1454
942
  ] }),
1455
943
  /* @__PURE__ */ jsxs10("div", { className: "bg-white p-6 rounded-2xl border border-slate-200/80 shadow-sm space-y-5", children: [
1456
- /* @__PURE__ */ jsxs10("div", { className: "flex justify-between items-center w-full", children: [
1457
- /* @__PURE__ */ jsx11("div", { className: "w-full max-w-xs", children: /* @__PURE__ */ jsx11(SearchBar, {}) }),
1458
- /* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsxs10(
944
+ /* @__PURE__ */ jsxs10("div", { className: "flex justify-between items-center w-full gap-4", children: [
945
+ /* @__PURE__ */ jsx10("div", { className: "w-full max-w-xs", children: /* @__PURE__ */ jsx10(SearchBar2, { searchQuery, setSearchQuery, setCurrentPage }) }),
946
+ /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsxs10(
947
+ "select",
948
+ {
949
+ value: pageSize,
950
+ onChange: handlePageSizeChange,
951
+ className: "border border-slate-200 rounded-lg px-3 py-2 text-sm bg-white cursor-pointer outline-none shadow-sm text-slate-700",
952
+ children: [
953
+ /* @__PURE__ */ jsx10("option", { value: 5, children: "5 Rows" }),
954
+ /* @__PURE__ */ jsx10("option", { value: 10, children: "10 Rows" }),
955
+ /* @__PURE__ */ jsx10("option", { value: 20, children: "20 Rows" }),
956
+ /* @__PURE__ */ jsx10("option", { value: 25, children: "25 Rows" })
957
+ ]
958
+ }
959
+ ) })
960
+ ] }),
961
+ /* @__PURE__ */ jsx10(
962
+ WorkflowTypeTable,
963
+ {
964
+ pageSize,
965
+ searchQuery,
966
+ currentPage,
967
+ setCurrentPage,
968
+ setTotalEntries
969
+ }
970
+ )
971
+ ] })
972
+ ] }),
973
+ /* @__PURE__ */ jsx10(
974
+ AddWorkflowTypeModal,
975
+ {
976
+ isOpen: modalOpen,
977
+ onClose: () => setModalOpen(false)
978
+ }
979
+ )
980
+ ] });
981
+ }
982
+
983
+ // src/components/WorkflowStep/main.js
984
+ import React14, { useState as useState5 } from "react";
985
+
986
+ // src/components/Common/footer.js
987
+ import React11 from "react";
988
+ import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
989
+ function Footer() {
990
+ return /* @__PURE__ */ jsxs11("div", { className: "flex justify-between items-center px-6 py-4 sticky bottom-0 z-10 border-t border-gray-200 rounded-xl bg-slate-50/50 shadow-md", children: [
991
+ /* @__PURE__ */ jsx11("div", { className: "text-sm text-slate-500", children: "Showing 1 to 5 entries" }),
992
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
993
+ /* @__PURE__ */ jsx11("button", { className: "px-2 py-1 text-[15px] border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "\u2039 Prev" }),
994
+ /* @__PURE__ */ jsx11("button", { className: "w-7 h-7 text-[15px] border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "1" }),
995
+ /* @__PURE__ */ jsx11("button", { className: "w-7 h-7 text-[15px] border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "2" }),
996
+ /* @__PURE__ */ jsx11("button", { className: "w-7 h-7 text-[15px] border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "3" }),
997
+ /* @__PURE__ */ jsx11("button", { className: "w-7 h-7 text-[15px] border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "4" }),
998
+ /* @__PURE__ */ jsx11("button", { className: "px-2 py-1 text-[15px] border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "Next \u203A" })
999
+ ] })
1000
+ ] });
1001
+ }
1002
+
1003
+ // src/components/WorkflowStep/main.js
1004
+ import Link2 from "next/link";
1005
+
1006
+ // src/components/WorkflowStep/AddWorkflowStepModal.js
1007
+ import React12 from "react";
1008
+ import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
1009
+ function AddWorkflowStepModal({ onClose }) {
1010
+ return /* @__PURE__ */ jsxs12("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1011
+ /* @__PURE__ */ jsx12(
1012
+ "div",
1013
+ {
1014
+ className: "fixed inset-0 bg-slate-900/50 backdrop-blur-sm transition-opacity duration-200",
1015
+ onClick: onClose
1016
+ }
1017
+ ),
1018
+ /* @__PURE__ */ jsxs12("div", { className: "relative w-full max-w-4xl bg-white rounded-3xl shadow-2xl flex flex-col z-10 max-h-[92vh] overflow-hidden animate-in fade-in zoom-in-95 duration-200", children: [
1019
+ /* @__PURE__ */ jsxs12("div", { className: "flex justify-between items-center px-8 py-6 border-b border-slate-100", children: [
1020
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-4", children: [
1021
+ /* @__PURE__ */ jsx12("div", { className: "w-12 h-12 bg-indigo-50 text-indigo-600 rounded-xl flex items-center justify-center shadow-sm", children: /* @__PURE__ */ jsx12("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx12("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }) }) }),
1022
+ /* @__PURE__ */ jsxs12("div", { children: [
1023
+ /* @__PURE__ */ jsx12("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add WorkflowStep" }),
1024
+ /* @__PURE__ */ jsx12("p", { className: "text-xs text-slate-400 mt-0.5", children: "Create a new workflowStep and configure its details" })
1025
+ ] })
1026
+ ] }),
1027
+ /* @__PURE__ */ jsx12(
1028
+ "button",
1029
+ {
1030
+ onClick: onClose,
1031
+ className: "text-slate-400 hover:text-slate-600 hover:bg-slate-100 p-2 rounded-full transition-all text-sm font-semibold",
1032
+ children: "\u2715"
1033
+ }
1034
+ )
1035
+ ] }),
1036
+ /* @__PURE__ */ jsxs12("div", { className: "p-8 space-y-8 overflow-y-auto max-h-[calc(92vh-170px)] bg-slate-50/30", children: [
1037
+ /* @__PURE__ */ jsxs12("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1038
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1039
+ /* @__PURE__ */ jsx12("span", { children: "\u{1F4CB}" }),
1040
+ /* @__PURE__ */ jsx12("span", { children: "WorkflowStep Information" })
1041
+ ] }),
1042
+ /* @__PURE__ */ jsxs12("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1043
+ /* @__PURE__ */ jsxs12("div", { children: [
1044
+ /* @__PURE__ */ jsxs12("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1045
+ "SLA Type ",
1046
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1047
+ ] }),
1048
+ /* @__PURE__ */ jsxs12("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-400 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1049
+ /* @__PURE__ */ jsx12("option", { value: "", children: "Select SLA type" }),
1050
+ /* @__PURE__ */ jsx12("option", { value: "petition", children: "Hours" }),
1051
+ /* @__PURE__ */ jsx12("option", { value: "building", children: "Days" })
1052
+ ] }),
1053
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Choose the category this workflowStep belongs to" })
1054
+ ] }),
1055
+ /* @__PURE__ */ jsxs12("div", { children: [
1056
+ /* @__PURE__ */ jsxs12("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1057
+ "Step Code ",
1058
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1059
+ ] }),
1060
+ /* @__PURE__ */ jsx12(
1061
+ "input",
1062
+ {
1063
+ type: "text",
1064
+ placeholder: "Enter StepCode",
1065
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1066
+ }
1067
+ ),
1068
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Unique code for this workflowStep (e.g., APR,SCR)" })
1069
+ ] })
1070
+ ] }),
1071
+ /* @__PURE__ */ jsxs12("div", { children: [
1072
+ /* @__PURE__ */ jsxs12("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1073
+ "StepName ",
1074
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1075
+ ] }),
1076
+ /* @__PURE__ */ jsx12(
1077
+ "input",
1078
+ {
1079
+ type: "text",
1080
+ placeholder: "Enter StepName",
1081
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1082
+ }
1083
+ ),
1084
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Enter a descriptive name for this workflowStep" })
1085
+ ] }),
1086
+ /* @__PURE__ */ jsxs12("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1087
+ /* @__PURE__ */ jsxs12("div", { children: [
1088
+ /* @__PURE__ */ jsxs12("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1089
+ "ReminderBefore",
1090
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1091
+ ] }),
1092
+ /* @__PURE__ */ jsx12(
1093
+ "input",
1094
+ {
1095
+ type: "text",
1096
+ defaultValue: "1",
1097
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1098
+ }
1099
+ ),
1100
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "WorkflowStep Reminder" })
1101
+ ] }),
1102
+ /* @__PURE__ */ jsxs12("div", { children: [
1103
+ /* @__PURE__ */ jsxs12("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1104
+ "EscalationAfter",
1105
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1106
+ ] }),
1107
+ /* @__PURE__ */ jsx12(
1108
+ "input",
1109
+ {
1110
+ type: "text",
1111
+ defaultValue: "1",
1112
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1113
+ }
1114
+ ),
1115
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "WorkflowStep Escalation" })
1116
+ ] }),
1117
+ /* @__PURE__ */ jsxs12("div", { children: [
1118
+ /* @__PURE__ */ jsxs12("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1119
+ "Working Hours Only",
1120
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1121
+ ] }),
1122
+ /* @__PURE__ */ jsx12(
1123
+ "input",
1124
+ {
1125
+ type: "text",
1126
+ defaultValue: "1",
1127
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1128
+ }
1129
+ ),
1130
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Enter Working Hours" })
1131
+ ] }),
1132
+ /* @__PURE__ */ jsxs12("div", { children: [
1133
+ /* @__PURE__ */ jsxs12("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1134
+ "Exclude Holidays",
1135
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1136
+ ] }),
1137
+ /* @__PURE__ */ jsx12(
1138
+ "input",
1139
+ {
1140
+ type: "text",
1141
+ defaultValue: "1",
1142
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1143
+ }
1144
+ ),
1145
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Enter Holidays" })
1146
+ ] })
1147
+ ] })
1148
+ ] }),
1149
+ /* @__PURE__ */ jsxs12("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-3", children: [
1150
+ /* @__PURE__ */ jsxs12("div", { className: "flex justify-between items-center", children: [
1151
+ /* @__PURE__ */ jsx12("label", { className: "block text-xs font-bold text-slate-700", children: "Description" }),
1152
+ /* @__PURE__ */ jsx12("span", { className: "text-[10px] text-slate-400", children: "0 / 500" })
1153
+ ] }),
1154
+ /* @__PURE__ */ jsx12(
1155
+ "textarea",
1156
+ {
1157
+ rows: 3,
1158
+ placeholder: "Enter workflow description (optional)",
1159
+ className: "w-full p-3 border border-slate-200 rounded-xl text-xs resize-none focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1160
+ }
1161
+ ),
1162
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400", children: "Provide additional information about this WorkflowStep" })
1163
+ ] }),
1164
+ /* @__PURE__ */ jsxs12("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1165
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1166
+ /* @__PURE__ */ jsx12("span", { children: "\u2699\uFE0F" }),
1167
+ /* @__PURE__ */ jsx12("span", { children: "Status & Settings" })
1168
+ ] }),
1169
+ /* @__PURE__ */ jsx12("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: /* @__PURE__ */ jsxs12("div", { children: [
1170
+ /* @__PURE__ */ jsx12("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: "Default Priority" }),
1171
+ /* @__PURE__ */ jsxs12("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1172
+ /* @__PURE__ */ jsx12("option", { value: "medium", children: "Medium" }),
1173
+ /* @__PURE__ */ jsx12("option", { value: "high", children: "High" }),
1174
+ /* @__PURE__ */ jsx12("option", { value: "low", children: "Low" })
1175
+ ] }),
1176
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Default priority for tasks in this WorkflowStep" })
1177
+ ] }) })
1178
+ ] }),
1179
+ /* @__PURE__ */ jsxs12("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1180
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1181
+ /* @__PURE__ */ jsx12("span", { children: "\u{1F6E0}\uFE0F" }),
1182
+ /* @__PURE__ */ jsx12("span", { children: "Additional Settings" })
1183
+ ] }),
1184
+ /* @__PURE__ */ jsxs12("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
1185
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1186
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-3", children: [
1187
+ /* @__PURE__ */ jsx12("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u23F1\uFE0F" }),
1188
+ /* @__PURE__ */ jsxs12("div", { children: [
1189
+ /* @__PURE__ */ jsx12("p", { className: "text-xs font-bold text-slate-700", children: "Enable SLA" }),
1190
+ /* @__PURE__ */ jsx12("p", { className: "text-[9px] text-slate-400", children: "Enable SLA for workflow" })
1191
+ ] })
1192
+ ] }),
1193
+ /* @__PURE__ */ jsxs12("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1194
+ /* @__PURE__ */ jsx12("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1195
+ /* @__PURE__ */ jsx12("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1196
+ ] })
1197
+ ] }),
1198
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1199
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-3", children: [
1200
+ /* @__PURE__ */ jsx12("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F504}" }),
1201
+ /* @__PURE__ */ jsxs12("div", { children: [
1202
+ /* @__PURE__ */ jsx12("p", { className: "text-xs font-bold text-slate-700", children: "Allow Rework" }),
1203
+ /* @__PURE__ */ jsx12("p", { className: "text-[9px] text-slate-400", children: "Allow files to be sent back" })
1204
+ ] })
1205
+ ] }),
1206
+ /* @__PURE__ */ jsxs12("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1207
+ /* @__PURE__ */ jsx12("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1208
+ /* @__PURE__ */ jsx12("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1209
+ ] })
1210
+ ] }),
1211
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1212
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-3", children: [
1213
+ /* @__PURE__ */ jsx12("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F465}" }),
1214
+ /* @__PURE__ */ jsxs12("div", { children: [
1215
+ /* @__PURE__ */ jsx12("p", { className: "text-xs font-bold text-slate-700", children: "Allow File Delegation" }),
1216
+ /* @__PURE__ */ jsx12("p", { className: "text-[9px] text-slate-400", children: "Allow users to delegate tasks" })
1217
+ ] })
1218
+ ] }),
1219
+ /* @__PURE__ */ jsxs12("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1220
+ /* @__PURE__ */ jsx12("input", { type: "checkbox", className: "sr-only peer" }),
1221
+ /* @__PURE__ */ jsx12("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1222
+ ] })
1223
+ ] })
1224
+ ] })
1225
+ ] })
1226
+ ] }),
1227
+ /* @__PURE__ */ jsxs12("div", { className: "p-5 bg-white border-t border-slate-100 flex items-center justify-end gap-3 px-8", children: [
1228
+ /* @__PURE__ */ jsx12(
1229
+ "button",
1230
+ {
1231
+ onClick: onClose,
1232
+ className: "px-6 py-2.5 border border-slate-200 text-slate-600 text-xs font-bold rounded-xl hover:bg-slate-50 transition-all flex items-center gap-1.5",
1233
+ children: "\u2715 Cancel"
1234
+ }
1235
+ ),
1236
+ /* @__PURE__ */ jsx12(
1237
+ "button",
1238
+ {
1239
+ type: "button",
1240
+ className: "px-6 py-2.5 bg-indigo-600 hover:bg-indigo-700 text-white text-xs font-bold rounded-xl shadow-md shadow-indigo-500/10 transition-all flex items-center gap-1.5",
1241
+ children: "\u{1F4BE} Save WorkflowStep"
1242
+ }
1243
+ )
1244
+ ] })
1245
+ ] })
1246
+ ] });
1247
+ }
1248
+
1249
+ // src/components/Common/commonheader.js
1250
+ import React13 from "react";
1251
+ import Link from "next/link";
1252
+ import {
1253
+ FolderKanban,
1254
+ Home,
1255
+ ChevronRight,
1256
+ Plus
1257
+ } from "lucide-react";
1258
+ import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
1259
+ function CommonHeader({
1260
+ title,
1261
+ breadcrumbs = [],
1262
+ buttonText,
1263
+ onButtonClick
1264
+ }) {
1265
+ return /* @__PURE__ */ jsxs13("div", { className: "relative overflow-hidden rounded-2xl border border-slate-200 bg-white/90 backdrop-blur-xl shadow-lg mb-6", children: [
1266
+ /* @__PURE__ */ jsx13("div", { className: "absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-blue-500 via-cyan-400 to-indigo-500" }),
1267
+ /* @__PURE__ */ jsx13("div", { className: "absolute -top-12 -right-12 h-40 w-40 rounded-full bg-blue-200/20 blur-3xl" }),
1268
+ /* @__PURE__ */ jsx13("div", { className: "absolute -bottom-10 -left-10 h-32 w-32 rounded-full bg-cyan-200/20 blur-3xl" }),
1269
+ /* @__PURE__ */ jsxs13("div", { className: "relative flex items-center justify-between px-6 py-4", children: [
1270
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-4", children: [
1271
+ /* @__PURE__ */ jsx13("div", { className: "flex h-12 w-12 items-center justify-center rounded-xl bg-gradient-to-br from-blue-600 to-indigo-600 text-white shadow-lg transition-all duration-300 hover:scale-110 hover:rotate-6", children: /* @__PURE__ */ jsx13(FolderKanban, { size: 22 }) }),
1272
+ /* @__PURE__ */ jsxs13("div", { children: [
1273
+ /* @__PURE__ */ jsx13("h1", { className: "text-2xl font-bold text-slate-800 tracking-tight", children: title }),
1274
+ /* @__PURE__ */ jsxs13("div", { className: "mt-2 flex items-center gap-2 flex-wrap", children: [
1275
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1 rounded-full bg-slate-100 px-3 py-1 text-xs font-medium text-slate-600 transition-all duration-300 hover:bg-blue-50 hover:text-blue-600", children: [
1276
+ /* @__PURE__ */ jsx13(Home, { size: 13 }),
1277
+ "Home"
1278
+ ] }),
1279
+ breadcrumbs.map((item, index) => /* @__PURE__ */ jsxs13(React13.Fragment, { children: [
1280
+ /* @__PURE__ */ jsx13(
1281
+ ChevronRight,
1282
+ {
1283
+ size: 15,
1284
+ className: "text-slate-300"
1285
+ }
1286
+ ),
1287
+ index === breadcrumbs.length - 1 ? /* @__PURE__ */ jsx13("span", { className: "rounded-full bg-blue-600 px-3 py-1 text-xs font-semibold text-white shadow-md", children: item.label }) : /* @__PURE__ */ jsx13(
1288
+ Link,
1289
+ {
1290
+ href: item.href,
1291
+ className: "rounded-full bg-slate-100 px-3 py-1 text-xs font-medium text-slate-600 transition-all duration-300 hover:-translate-y-0.5 hover:bg-blue-50 hover:text-blue-600",
1292
+ children: item.label
1293
+ }
1294
+ )
1295
+ ] }, index))
1296
+ ] })
1297
+ ] })
1298
+ ] }),
1299
+ /* @__PURE__ */ jsxs13(
1300
+ "button",
1301
+ {
1302
+ onClick: onButtonClick,
1303
+ className: "group relative overflow-hidden rounded-xl bg-gradient-to-r from-blue-600 to-indigo-600 px-5 py-2.5 text-sm font-semibold text-white shadow-lg transition-all duration-300 hover:-translate-y-0.5 hover:shadow-xl hover:shadow-blue-500/30 active:scale-95",
1304
+ children: [
1305
+ /* @__PURE__ */ jsx13("span", { className: "absolute inset-0 -translate-x-full skew-x-12 bg-white/20 transition-transform duration-1000 group-hover:translate-x-[250%]" }),
1306
+ /* @__PURE__ */ jsxs13("span", { className: "relative flex items-center gap-2", children: [
1307
+ /* @__PURE__ */ jsx13(
1308
+ Plus,
1309
+ {
1310
+ size: 18,
1311
+ className: "transition-transform duration-300 group-hover:rotate-90"
1312
+ }
1313
+ ),
1314
+ buttonText
1315
+ ] })
1316
+ ]
1317
+ }
1318
+ )
1319
+ ] })
1320
+ ] });
1321
+ }
1322
+
1323
+ // src/components/WorkflowStep/main.js
1324
+ import { Fragment, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
1325
+ var workflowSteps = [
1326
+ {
1327
+ workflowStepId: 1,
1328
+ workflowId: 1,
1329
+ stepCode: "SCR",
1330
+ stepName: "Scrutiny",
1331
+ sequenceNo: 1,
1332
+ slaType: "Hours",
1333
+ slaValue: 48,
1334
+ reminderBefore: 4,
1335
+ escalationAfter: 48,
1336
+ workingHoursOnly: 1,
1337
+ excludeHolidays: 1
1338
+ },
1339
+ {
1340
+ workflowStepId: 1,
1341
+ workflowId: 1,
1342
+ stepCode: "SCR",
1343
+ stepName: "Scrutiny",
1344
+ sequenceNo: 1,
1345
+ slaType: "Hours",
1346
+ slaValue: 48,
1347
+ reminderBefore: 4,
1348
+ escalationAfter: 48,
1349
+ workingHoursOnly: 1,
1350
+ excludeHolidays: 1
1351
+ },
1352
+ {
1353
+ workflowStepId: 1,
1354
+ workflowId: 1,
1355
+ stepCode: "SCR",
1356
+ stepName: "Scrutiny",
1357
+ sequenceNo: 1,
1358
+ slaType: "Hours",
1359
+ slaValue: 48,
1360
+ reminderBefore: 4,
1361
+ escalationAfter: 48,
1362
+ workingHoursOnly: 1,
1363
+ excludeHolidays: 1
1364
+ },
1365
+ {
1366
+ workflowStepId: 1,
1367
+ workflowId: 1,
1368
+ stepCode: "SCR",
1369
+ stepName: "Scrutiny",
1370
+ sequenceNo: 1,
1371
+ slaType: "Hours",
1372
+ slaValue: 48,
1373
+ reminderBefore: 4,
1374
+ escalationAfter: 48,
1375
+ workingHoursOnly: 1,
1376
+ excludeHolidays: 1
1377
+ },
1378
+ {
1379
+ workflowStepId: 1,
1380
+ workflowId: 1,
1381
+ stepCode: "SCR",
1382
+ stepName: "Scrutiny",
1383
+ sequenceNo: 1,
1384
+ slaType: "Hours",
1385
+ slaValue: 48,
1386
+ reminderBefore: 4,
1387
+ escalationAfter: 48,
1388
+ workingHoursOnly: 1,
1389
+ excludeHolidays: 1
1390
+ },
1391
+ {
1392
+ workflowStepId: 1,
1393
+ workflowId: 1,
1394
+ stepCode: "SCR",
1395
+ stepName: "Scrutiny",
1396
+ sequenceNo: 1,
1397
+ slaType: "Hours",
1398
+ slaValue: 48,
1399
+ reminderBefore: 4,
1400
+ escalationAfter: 48,
1401
+ workingHoursOnly: 1,
1402
+ excludeHolidays: 1
1403
+ },
1404
+ {
1405
+ workflowStepId: 2,
1406
+ workflowId: 1,
1407
+ stepCode: "APR",
1408
+ stepName: "Approval",
1409
+ sequenceNo: 2,
1410
+ slaType: "Days",
1411
+ slaValue: 2,
1412
+ reminderBefore: 1,
1413
+ escalationAfter: 2,
1414
+ workingHoursOnly: 1,
1415
+ excludeHolidays: 1
1416
+ },
1417
+ {
1418
+ workflowStepId: 3,
1419
+ workflowId: 1,
1420
+ stepCode: "APR",
1421
+ stepName: "Approval",
1422
+ sequenceNo: 3,
1423
+ slaType: "Days",
1424
+ slaValue: 2,
1425
+ reminderBefore: 1,
1426
+ escalationAfter: 2,
1427
+ workingHoursOnly: 1,
1428
+ excludeHolidays: 1
1429
+ },
1430
+ {
1431
+ workflowStepId: 4,
1432
+ workflowId: 1,
1433
+ stepCode: "APR",
1434
+ stepName: "Approval",
1435
+ sequenceNo: 4,
1436
+ slaType: "Days",
1437
+ slaValue: 2,
1438
+ reminderBefore: 1,
1439
+ escalationAfter: 2,
1440
+ workingHoursOnly: 1,
1441
+ excludeHolidays: 1
1442
+ },
1443
+ {
1444
+ workflowStepId: 5,
1445
+ workflowId: 1,
1446
+ stepCode: "APR",
1447
+ stepName: "Approval",
1448
+ sequenceNo: 5,
1449
+ slaType: "Days",
1450
+ slaValue: 2,
1451
+ reminderBefore: 1,
1452
+ escalationAfter: 2,
1453
+ workingHoursOnly: 1,
1454
+ excludeHolidays: 1
1455
+ }
1456
+ ];
1457
+ function WorkflowStep() {
1458
+ const [showModal, setShowModal] = useState5(false);
1459
+ const [pageSize, setPageSize] = useState5(5);
1460
+ const [sortConfig, setSortConfig] = useState5({
1461
+ key: "",
1462
+ direction: "asc"
1463
+ });
1464
+ const handleSort = (key) => {
1465
+ let direction = "asc";
1466
+ if (sortConfig.key === key && sortConfig.direction === "asc") {
1467
+ direction = "desc";
1468
+ }
1469
+ setSortConfig({ key, direction });
1470
+ };
1471
+ return /* @__PURE__ */ jsxs14(Fragment, { children: [
1472
+ /* @__PURE__ */ jsxs14("div", { className: "p-5 bg-[#f5f7fb] min-h-screen font-sans text-slate-700 flex flex-col ", children: [
1473
+ /* @__PURE__ */ jsx14(
1474
+ CommonHeader,
1475
+ {
1476
+ title: "Workflow",
1477
+ breadcrumbs: [
1478
+ { label: "Dashboard", href: "/dashboard" },
1479
+ { label: "Masters", href: "/masters" },
1480
+ { label: "Workflow Step", href: "/workflowStep" }
1481
+ ],
1482
+ buttonText: "Add Workflow Step",
1483
+ onButtonClick: () => setShowModal(true)
1484
+ }
1485
+ ),
1486
+ /* @__PURE__ */ jsxs14("div", { className: "bg-white rounded-3xl shadow-sm border border-slate-100 p-6 flex flex-col gap-6", children: [
1487
+ /* @__PURE__ */ jsxs14("div", { className: "flex justify-between items-center flex-wrap gap-3", children: [
1488
+ /* @__PURE__ */ jsxs14("div", { className: "relative max-w-xs w-full", children: [
1489
+ /* @__PURE__ */ jsx14("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3.5 pointer-events-none", children: /* @__PURE__ */ jsx14("svg", { className: "w-4 h-5 text-slate-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx14("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) }),
1490
+ /* @__PURE__ */ jsx14(
1491
+ "input",
1492
+ {
1493
+ type: "text",
1494
+ placeholder: "Search workflow name or code...",
1495
+ className: "w-full pl-10 pr-4 py-2.5 border border-slate-200 rounded-xl text-xs bg-slate-50/50 focus:outline-none focus:ring-4 focus:ring-blue-500/10 focus:border-blue-500 text-slate-700 placeholder-slate-400 transition-all shadow-md"
1496
+ }
1497
+ )
1498
+ ] }),
1499
+ /* @__PURE__ */ jsx14("div", { className: "flex items-center gap-2 text-xs text-slate-500 font-semibold", children: /* @__PURE__ */ jsxs14(
1459
1500
  "select",
1460
1501
  {
1461
1502
  value: pageSize,
1462
1503
  onChange: (e) => setPageSize(Number(e.target.value)),
1463
- className: "border border-slate-200 rounded-lg px-3 py-2 text-sm bg-white cursor-pointer outline-none shadow-sm text-slate-700",
1504
+ className: "inline-flex items-center px-4 py-2 rounded-xl bg-white text-slate-700 text-[14px] font-semibold border border-slate-200 focus:outline-none cursor-pointer shadow-md",
1464
1505
  children: [
1465
- /* @__PURE__ */ jsx11("option", { value: 2, children: "2 Rows (Testing)" }),
1466
- /* @__PURE__ */ jsx11("option", { value: 10, children: "10 Rows" }),
1467
- /* @__PURE__ */ jsx11("option", { value: 20, children: "20 Rows" }),
1468
- /* @__PURE__ */ jsx11("option", { value: 50, children: "50 Rows" })
1506
+ /* @__PURE__ */ jsx14("option", { value: 5, children: "5 Rows" }),
1507
+ /* @__PURE__ */ jsx14("option", { value: 10, children: "10 Rows" }),
1508
+ /* @__PURE__ */ jsx14("option", { value: 25, children: "25 Rows" })
1469
1509
  ]
1470
1510
  }
1471
1511
  ) })
1472
1512
  ] }),
1473
- /* @__PURE__ */ jsx11(WorkflowTypeTable, { pageSize })
1513
+ /* @__PURE__ */ jsx14("div", { className: "border border-slate-200 rounded-2xl overflow-hidden bg-white shadow-md", children: /* @__PURE__ */ jsx14("div", { className: "max-h-[350px] overflow-y-auto overflow-x-auto", children: /* @__PURE__ */ jsxs14("table", { className: "min-w-max w-full border-collapse", children: [
1514
+ /* @__PURE__ */ jsx14("thead", { className: "bg-slate-50 sticky top-0 z-10", children: /* @__PURE__ */ jsx14("tr", { className: "text-[11px] font-bold uppercase tracking-wider text-slate-400", children: [
1515
+ { label: "WorkflowStepId", key: "workflowStepId" },
1516
+ { label: "WorkflowId", key: "workflowId" },
1517
+ { label: "StepCode", key: "stepCode" },
1518
+ { label: "StepName", key: "stepName" },
1519
+ { label: "SequenceNo", key: "sequenceNo" },
1520
+ { label: "SLA Type", key: "slaType" },
1521
+ { label: "SLA Value", key: "slaValue" },
1522
+ { label: "Reminder Before", key: "reminderBefore" },
1523
+ { label: "Escalation After", key: "escalationAfter" },
1524
+ { label: "Working Hours Only", key: "workingHoursOnly" },
1525
+ { label: "Exclude Holidays", key: "excludeHolidays" }
1526
+ ].map((column) => /* @__PURE__ */ jsx14(
1527
+ "th",
1528
+ {
1529
+ onClick: () => handleSort(column.key),
1530
+ className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider cursor-pointer select-none hover:bg-slate-100 transition-colors",
1531
+ children: /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-center gap-1.5", children: [
1532
+ /* @__PURE__ */ jsx14("span", { className: "truncate", children: column.label }),
1533
+ /* @__PURE__ */ jsx14("span", { className: "text-slate-300 text-[10px]", children: sortConfig.key === column.key ? sortConfig.direction === "asc" ? "\u25B2" : "\u25BC" : "\u2195" })
1534
+ ] })
1535
+ },
1536
+ column.key
1537
+ )) }) }),
1538
+ /* @__PURE__ */ jsx14("tbody", { children: workflowSteps.slice(0, pageSize).map((item) => /* @__PURE__ */ jsxs14("tr", { className: "hover:bg-slate-50/80 transition-colors border-b border-slate-100 last:border-0", children: [
1539
+ /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 text-center text-align center text-[14px] text-slate-600 font-bold", children: item.workflowStepId }),
1540
+ /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 text-center text-align center text-[14px] text-slate-600 font-bold", children: item.workflowId }),
1541
+ /* @__PURE__ */ jsx14("td", { className: "px-2 py-4 text-center text-[14px]", children: /* @__PURE__ */ jsx14("span", { className: "inline-flex items-center px-2 py-0.5 rounded-md bg-slate-100 text-slate-600 text-xs font-bold border border-slate-200 truncate", children: item.stepCode }) }),
1542
+ /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 text-center text-align center text-[14px] text-slate-500 font-semibold ", children: item.stepName }),
1543
+ /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 text-center text-align center text-[14px] text-slate-600 font-bold", children: item.sequenceNo }),
1544
+ /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 text-center text-align center text-[14px] text-slate-500 font-semibold", children: item.slaType }),
1545
+ /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 text-center text-align center text-[14px] text-slate-600 font-bold", children: item.slaValue }),
1546
+ /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 text-center text-align center text-[14px] text-slate-600 font-bold", children: item.reminderBefore }),
1547
+ /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 text-center text-align center text-[14px] text-slate-600 font-bold", children: item.escalationAfter }),
1548
+ /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 text-center text-align center text-[14px] text-slate-600 font-bold", children: item.workingHoursOnly }),
1549
+ /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 text-center text-align center text-[14px] text-slate-600 font-bold", children: item.excludeHolidays })
1550
+ ] }, item.workflowStepId)) })
1551
+ ] }) }) }),
1552
+ /* @__PURE__ */ jsx14("div", { className: "rounded-xl bg-slate-50/50", children: /* @__PURE__ */ jsx14(Footer, {}) })
1474
1553
  ] })
1475
1554
  ] }),
1476
- /* @__PURE__ */ jsx11(
1477
- AddWorkflowTypeModal,
1478
- {
1479
- isOpen: modalOpen,
1480
- onClose: () => setModalOpen(false)
1481
- }
1482
- )
1555
+ showModal && /* @__PURE__ */ jsx14(AddWorkflowStepModal, { onClose: () => setShowModal(false) })
1483
1556
  ] });
1484
1557
  }
1485
1558
 
1486
1559
  // src/components/WorkFlowTransition/Transitiontable.js
1487
- import React11, { useState as useState7 } from "react";
1560
+ import React16, { useState as useState6 } from "react";
1488
1561
  import Link3 from "next/link";
1489
1562
 
1490
1563
  // src/components/WorkFlowTransition/AddWorkFlowTransitionModal.js
1491
- import React9 from "react";
1492
- import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1493
- function AddWorkTransitionStepModal({ onClose }) {
1494
- return /* @__PURE__ */ jsxs11("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1495
- /* @__PURE__ */ jsx12(
1496
- "div",
1497
- {
1498
- className: "fixed inset-0 bg-slate-900/50 backdrop-blur-sm transition-opacity duration-200",
1499
- onClick: onClose
1500
- }
1501
- ),
1502
- /* @__PURE__ */ jsxs11("div", { className: "relative w-full max-w-4xl bg-white rounded-3xl shadow-2xl flex flex-col z-10 max-h-[92vh] overflow-hidden animate-in fade-in zoom-in-95 duration-200", children: [
1503
- /* @__PURE__ */ jsxs11("div", { className: "flex justify-between items-center px-8 py-6 border-b border-slate-100", children: [
1504
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-4", children: [
1505
- /* @__PURE__ */ jsx12("div", { className: "w-12 h-12 bg-indigo-50 text-indigo-600 rounded-xl flex items-center justify-center shadow-sm", children: /* @__PURE__ */ jsx12("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx12("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }) }) }),
1506
- /* @__PURE__ */ jsxs11("div", { children: [
1507
- /* @__PURE__ */ jsx12("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add Workflow" }),
1508
- /* @__PURE__ */ jsx12("p", { className: "text-xs text-slate-400 mt-0.5", children: "Create a new workflow and configure its details" })
1509
- ] })
1510
- ] }),
1511
- /* @__PURE__ */ jsx12(
1512
- "button",
1513
- {
1514
- onClick: onClose,
1515
- className: "text-slate-400 hover:text-slate-600 hover:bg-slate-100 p-2 rounded-full transition-all text-sm font-semibold",
1516
- children: "\u2715"
1517
- }
1518
- )
1519
- ] }),
1520
- /* @__PURE__ */ jsxs11("div", { className: "p-8 space-y-8 overflow-y-auto max-h-[calc(92vh-170px)] bg-slate-50/30", children: [
1521
- /* @__PURE__ */ jsxs11("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1522
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1523
- /* @__PURE__ */ jsx12("span", { children: "\u{1F4CB}" }),
1524
- /* @__PURE__ */ jsx12("span", { children: "Workflow Information" })
1525
- ] }),
1526
- /* @__PURE__ */ jsxs11("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1527
- /* @__PURE__ */ jsxs11("div", { children: [
1528
- /* @__PURE__ */ jsxs11("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1529
- "Workflow Transition",
1530
- /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1531
- ] }),
1532
- /* @__PURE__ */ jsxs11("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1533
- /* @__PURE__ */ jsx12("option", { value: "", children: "Select workflow type" }),
1534
- /* @__PURE__ */ jsx12("option", { value: "petition", children: "Petition" }),
1535
- /* @__PURE__ */ jsx12("option", { value: "building", children: "Building Permission" }),
1536
- /* @__PURE__ */ jsx12("option", { value: "leave", children: "Leave" })
1537
- ] }),
1538
- /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Choose the category this workflow belongs to" })
1539
- ] }),
1540
- /* @__PURE__ */ jsxs11("div", { children: [
1541
- /* @__PURE__ */ jsxs11("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1542
- "Workflow Code ",
1543
- /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1544
- ] }),
1545
- /* @__PURE__ */ jsx12(
1546
- "input",
1547
- {
1548
- type: "text",
1549
- placeholder: "Enter workflow code",
1550
- className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1551
- }
1552
- ),
1553
- /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Unique code for this workflow (e.g., PET-001)" })
1554
- ] })
1555
- ] }),
1556
- /* @__PURE__ */ jsxs11("div", { children: [
1557
- /* @__PURE__ */ jsxs11("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1558
- "Workflow Name ",
1559
- /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1560
- ] }),
1561
- /* @__PURE__ */ jsx12(
1562
- "input",
1563
- {
1564
- type: "text",
1565
- placeholder: "Enter workflow name",
1566
- className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1567
- }
1568
- ),
1569
- /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Enter a descriptive name for this workflow" })
1570
- ] }),
1571
- /* @__PURE__ */ jsxs11("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1572
- /* @__PURE__ */ jsxs11("div", { children: [
1573
- /* @__PURE__ */ jsxs11("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1574
- "Version ",
1575
- /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1576
- ] }),
1577
- /* @__PURE__ */ jsx12(
1578
- "input",
1579
- {
1580
- type: "text",
1581
- defaultValue: "1",
1582
- className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1583
- }
1584
- ),
1585
- /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Workflow version number" })
1586
- ] }),
1587
- /* @__PURE__ */ jsxs11("div", { children: [
1588
- /* @__PURE__ */ jsxs11("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1589
- "Published ",
1590
- /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1591
- ] }),
1592
- /* @__PURE__ */ jsxs11("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1593
- /* @__PURE__ */ jsx12("option", { value: "false", children: "No" }),
1594
- /* @__PURE__ */ jsx12("option", { value: "true", children: "Yes" })
1595
- ] }),
1596
- /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Make workflow active for use" })
1597
- ] })
1598
- ] })
1599
- ] }),
1600
- /* @__PURE__ */ jsxs11("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-3", children: [
1601
- /* @__PURE__ */ jsxs11("div", { className: "flex justify-between items-center", children: [
1602
- /* @__PURE__ */ jsx12("label", { className: "block text-xs font-bold text-slate-700", children: "Description" }),
1603
- /* @__PURE__ */ jsx12("span", { className: "text-[10px] text-slate-400", children: "0 / 500" })
1604
- ] }),
1605
- /* @__PURE__ */ jsx12(
1606
- "textarea",
1607
- {
1608
- rows: 3,
1609
- placeholder: "Enter workflow description (optional)",
1610
- className: "w-full p-3 border border-slate-200 rounded-xl text-xs resize-none focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1611
- }
1612
- ),
1613
- /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400", children: "Provide additional information about this workflow" })
1614
- ] }),
1615
- /* @__PURE__ */ jsxs11("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1616
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1617
- /* @__PURE__ */ jsx12("span", { children: "\u2699\uFE0F" }),
1618
- /* @__PURE__ */ jsx12("span", { children: "Status & Settings" })
1619
- ] }),
1620
- /* @__PURE__ */ jsxs11("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1621
- /* @__PURE__ */ jsxs11("div", { children: [
1622
- /* @__PURE__ */ jsxs11("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1623
- "Status ",
1624
- /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1625
- ] }),
1626
- /* @__PURE__ */ jsxs11("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1627
- /* @__PURE__ */ jsx12("option", { value: "active", children: "Active" }),
1628
- /* @__PURE__ */ jsx12("option", { value: "inactive", children: "Inactive" })
1629
- ] }),
1630
- /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Set the initial status of this workflow" })
1631
- ] }),
1632
- /* @__PURE__ */ jsxs11("div", { children: [
1633
- /* @__PURE__ */ jsx12("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: "Default Priority" }),
1634
- /* @__PURE__ */ jsxs11("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1635
- /* @__PURE__ */ jsx12("option", { value: "medium", children: "Medium" }),
1636
- /* @__PURE__ */ jsx12("option", { value: "high", children: "High" }),
1637
- /* @__PURE__ */ jsx12("option", { value: "low", children: "Low" })
1638
- ] }),
1639
- /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Default priority for tasks in this workflow" })
1640
- ] })
1641
- ] })
1642
- ] }),
1643
- /* @__PURE__ */ jsxs11("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1644
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1645
- /* @__PURE__ */ jsx12("span", { children: "\u{1F6E0}\uFE0F" }),
1646
- /* @__PURE__ */ jsx12("span", { children: "Additional Settings" })
1647
- ] }),
1648
- /* @__PURE__ */ jsxs11("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
1649
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1650
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3", children: [
1651
- /* @__PURE__ */ jsx12("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u23F1\uFE0F" }),
1652
- /* @__PURE__ */ jsxs11("div", { children: [
1653
- /* @__PURE__ */ jsx12("p", { className: "text-xs font-bold text-slate-700", children: "Enable SLA" }),
1654
- /* @__PURE__ */ jsx12("p", { className: "text-[9px] text-slate-400", children: "Enable SLA for workflow" })
1655
- ] })
1656
- ] }),
1657
- /* @__PURE__ */ jsxs11("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1658
- /* @__PURE__ */ jsx12("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1659
- /* @__PURE__ */ jsx12("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1660
- ] })
1661
- ] }),
1662
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1663
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3", children: [
1664
- /* @__PURE__ */ jsx12("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F504}" }),
1665
- /* @__PURE__ */ jsxs11("div", { children: [
1666
- /* @__PURE__ */ jsx12("p", { className: "text-xs font-bold text-slate-700", children: "Allow Rework" }),
1667
- /* @__PURE__ */ jsx12("p", { className: "text-[9px] text-slate-400", children: "Allow files to be sent back" })
1668
- ] })
1669
- ] }),
1670
- /* @__PURE__ */ jsxs11("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1671
- /* @__PURE__ */ jsx12("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1672
- /* @__PURE__ */ jsx12("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1673
- ] })
1674
- ] }),
1675
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1676
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3", children: [
1677
- /* @__PURE__ */ jsx12("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F465}" }),
1678
- /* @__PURE__ */ jsxs11("div", { children: [
1679
- /* @__PURE__ */ jsx12("p", { className: "text-xs font-bold text-slate-700", children: "Allow File Delegation" }),
1680
- /* @__PURE__ */ jsx12("p", { className: "text-[9px] text-slate-400", children: "Allow users to delegate tasks" })
1681
- ] })
1682
- ] }),
1683
- /* @__PURE__ */ jsxs11("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1684
- /* @__PURE__ */ jsx12("input", { type: "checkbox", className: "sr-only peer" }),
1685
- /* @__PURE__ */ jsx12("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1686
- ] })
1687
- ] })
1688
- ] })
1689
- ] })
1690
- ] }),
1691
- /* @__PURE__ */ jsxs11("div", { className: "p-5 bg-white border-t border-slate-100 flex items-center justify-end gap-3 px-8", children: [
1692
- /* @__PURE__ */ jsx12(
1693
- "button",
1694
- {
1695
- onClick: onClose,
1696
- className: "px-6 py-2.5 border border-slate-200 text-slate-600 text-xs font-bold rounded-xl hover:bg-slate-50 transition-all flex items-center gap-1.5",
1697
- children: "\u2715 Cancel"
1698
- }
1699
- ),
1700
- /* @__PURE__ */ jsx12(
1701
- "button",
1702
- {
1703
- type: "button",
1704
- className: "px-6 py-2.5 bg-indigo-600 hover:bg-indigo-700 text-white text-xs font-bold rounded-xl shadow-md shadow-indigo-500/10 transition-all flex items-center gap-1.5",
1705
- children: "\u{1F4BE} Save Workflow"
1706
- }
1707
- )
1708
- ] })
1709
- ] })
1710
- ] });
1711
- }
1712
-
1713
- // src/components/WorkFlowTransition/Transitionheader.js
1714
- import React10, { useState as useState6 } from "react";
1715
- import Link2 from "next/link";
1716
- import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1717
- function Header() {
1718
- return /* @__PURE__ */ jsxs12("div", { className: "px-6 py-5 border-b border-gray-200", children: [
1719
- /* @__PURE__ */ jsx13("h1", { className: "m-0 text-[30px] leading-tight font-semibold text-[#1E293B] tracking-tight", children: "Workflow" }),
1720
- /* @__PURE__ */ jsxs12("div", { className: "mt-2 text-[13px] font-medium", children: [
1721
- /* @__PURE__ */ jsx13("a", { href: "/dashboard", className: "text-blue-600 hover:underline", children: "Dashboard" }),
1722
- /* @__PURE__ */ jsx13("span", { className: "mx-2 text-slate-400", children: ">" }),
1723
- /* @__PURE__ */ jsx13("a", { href: "/masters", className: "text-blue-600 hover:underline", children: "Masters" }),
1724
- /* @__PURE__ */ jsx13("span", { className: "mx-2 text-slate-400", children: ">" }),
1725
- /* @__PURE__ */ jsx13("a", { href: "/workflowTransition", className: "text-blue-600 hover:underline", children: "Workflow Transition" }),
1726
- /* @__PURE__ */ jsx13("span", { className: "mx-2 text-slate-400", children: ">" }),
1727
- /* @__PURE__ */ jsx13("span", { className: "text-slate-500", children: "Workflow Step" })
1728
- ] })
1729
- ] });
1730
- }
1564
+ import React15 from "react";
1565
+ import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
1731
1566
 
1732
1567
  // src/components/WorkFlowTransition/Transitiontable.js
1733
- import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1568
+ import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
1734
1569
  var WorkflowTransition = [
1570
+ {
1571
+ TransitionId: 1,
1572
+ workflowId: 1,
1573
+ FromStepId: 2,
1574
+ ToStepId: 1,
1575
+ ActionCode: "APPROVE",
1576
+ ActionName: "APPROVE"
1577
+ },
1578
+ {
1579
+ TransitionId: 1,
1580
+ workflowId: 1,
1581
+ FromStepId: 2,
1582
+ ToStepId: 1,
1583
+ ActionCode: "APPROVE",
1584
+ ActionName: "APPROVE"
1585
+ },
1586
+ {
1587
+ TransitionId: 1,
1588
+ workflowId: 1,
1589
+ FromStepId: 2,
1590
+ ToStepId: 1,
1591
+ ActionCode: "APPROVE",
1592
+ ActionName: "APPROVE"
1593
+ },
1594
+ {
1595
+ TransitionId: 1,
1596
+ workflowId: 1,
1597
+ FromStepId: 2,
1598
+ ToStepId: 1,
1599
+ ActionCode: "APPROVE",
1600
+ ActionName: "APPROVE"
1601
+ },
1602
+ {
1603
+ TransitionId: 1,
1604
+ workflowId: 1,
1605
+ FromStepId: 2,
1606
+ ToStepId: 1,
1607
+ ActionCode: "APPROVE",
1608
+ ActionName: "APPROVE"
1609
+ },
1735
1610
  {
1736
1611
  TransitionId: 1,
1737
1612
  workflowId: 1,
@@ -1774,9 +1649,9 @@ var WorkflowTransition = [
1774
1649
  }
1775
1650
  ];
1776
1651
  function WorkFlowTransition() {
1777
- const [showModal, setShowModal] = useState7(false);
1778
- const [pageSize, setPageSize] = useState7(5);
1779
- const [sortConfig, setSortConfig] = useState7({
1652
+ const [showModal, setShowModal] = useState6(false);
1653
+ const [pageSize, setPageSize] = useState6(5);
1654
+ const [sortConfig, setSortConfig] = useState6({
1780
1655
  key: "",
1781
1656
  direction: "asc"
1782
1657
  });
@@ -1790,103 +1665,119 @@ function WorkFlowTransition() {
1790
1665
  direction
1791
1666
  });
1792
1667
  };
1793
- return /* @__PURE__ */ jsx14("div", { className: "p-6 bg-[#f5f7fb] min-h-screen font-sans text-slate-700", children: /* @__PURE__ */ jsxs13("div", { className: "bg-white rounded-2xl shadow-md overflow-hidden", children: [
1794
- /* @__PURE__ */ jsx14(Header, {}),
1795
- /* @__PURE__ */ jsx14("div", { className: "px-6 py-5 border-b border-gray-200 ", children: /* @__PURE__ */ jsxs13("div", { className: "flex justify-between items-center flex-wrap gap-3", children: [
1796
- /* @__PURE__ */ jsx14(
1797
- "input",
1798
- {
1799
- type: "text",
1800
- placeholder: "Search workflow Transition...",
1801
- className: "w-[300px] px-4 py-2.5 border border-slate-200/80 rounded-lg text-[13px] text-slate-600 focus:outline-none bg-slate-50"
1802
- }
1803
- ),
1804
- /* @__PURE__ */ jsxs13("div", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: [
1805
- /* @__PURE__ */ jsx14("span", { children: "Show" }),
1806
- /* @__PURE__ */ jsxs13(
1668
+ return /* @__PURE__ */ jsx16("div", { className: "p-5 bg-[#f5f7fb] min-h-screen font-sans text-slate-700 flex flex-col ", children: /* @__PURE__ */ jsxs16("div", { className: "p-6", children: [
1669
+ /* @__PURE__ */ jsx16(
1670
+ CommonHeader,
1671
+ {
1672
+ title: "WorkFlow Transition",
1673
+ breadcrumbs: [
1674
+ {
1675
+ label: "Dashboard",
1676
+ href: "/dashboard"
1677
+ },
1678
+ {
1679
+ label: "Masters",
1680
+ href: "/masters"
1681
+ },
1682
+ {
1683
+ label: "Workflow Step",
1684
+ href: "/workflowTransition"
1685
+ }
1686
+ ],
1687
+ buttonText: "Add Workflow Transition",
1688
+ onButtonClick: () => setShowModal(true)
1689
+ }
1690
+ ),
1691
+ /* @__PURE__ */ jsxs16("div", { className: "bg-white rounded-3xl shadow-sm border border-slate-100 p-6 flex flex-col gap-6", children: [
1692
+ /* @__PURE__ */ jsxs16("div", { className: "flex justify-between items-center flex-wrap gap-3", children: [
1693
+ /* @__PURE__ */ jsxs16("div", { className: "relative max-w-xs w-full", children: [
1694
+ /* @__PURE__ */ jsx16("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3.5 pointer-events-none", children: /* @__PURE__ */ jsx16("svg", { className: "w-4 h-5 text-slate-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx16("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) }),
1695
+ /* @__PURE__ */ jsx16(
1696
+ "input",
1697
+ {
1698
+ type: "text",
1699
+ placeholder: "Search workflow name or code...",
1700
+ className: "w-full pl-10 pr-4 py-2.5 shadow-md border border-slate-200 rounded-xl text-xs bg-slate-50/50 focus:outline-none focus:ring-4 focus:ring-blue-500/10 focus:border-blue-500 text-slate-700 placeholder-slate-400 transition-all"
1701
+ }
1702
+ )
1703
+ ] }),
1704
+ /* @__PURE__ */ jsx16("div", { className: "flex items-center gap-2 text-xs text-slate-500 font-semibold", children: /* @__PURE__ */ jsxs16(
1807
1705
  "select",
1808
1706
  {
1809
1707
  value: pageSize,
1810
1708
  onChange: (e) => setPageSize(Number(e.target.value)),
1811
- className: "inline-flex item-center px-3 py-1 rounded-md bg-[#f1f5f9] text-[#334155] text-xs font-semibold border border-[#e2e8f0]",
1709
+ className: "inline-flex items-center px-4 py-2 rounded-xl bg-white text-slate-700 text-[14px] font-semibold border border-slate-200 focus:outline-none cursor-pointer shadow-md",
1812
1710
  children: [
1813
- /* @__PURE__ */ jsx14("option", { value: 5, children: "5" }),
1814
- /* @__PURE__ */ jsx14("option", { value: 10, children: "10" }),
1815
- /* @__PURE__ */ jsx14("option", { value: 25, children: "25" })
1711
+ /* @__PURE__ */ jsx16("option", { value: 5, children: "5 Rows" }),
1712
+ /* @__PURE__ */ jsx16("option", { value: 10, children: "10 Rows" }),
1713
+ /* @__PURE__ */ jsx16("option", { value: 25, children: "25 Rows" })
1816
1714
  ]
1817
1715
  }
1818
- ),
1819
- /* @__PURE__ */ jsx14("span", { children: "entries" })
1716
+ ) })
1820
1717
  ] }),
1821
- /* @__PURE__ */ jsx14(
1822
- "button",
1823
- {
1824
- onClick: () => setShowModal(true),
1825
- className: "px-5 py-2.5 bg-blue-600 text-white rounded-lg text-[13px] font-semibold hover:bg-blue-700 transition-colors",
1826
- children: "+ Add Workflow Transition"
1827
- }
1828
- )
1829
- ] }) }),
1830
- /* @__PURE__ */ jsxs13("div", { className: "overflow-x-auto", children: [
1831
- /* @__PURE__ */ jsxs13("table", { className: "w-full border-collapse", children: [
1832
- /* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsx14("tr", { className: "bg-slate-50/70 border-b border-slate-200 text-xs font-bold uppercase tracking-wider text-slate-500", children: [
1833
- { label: "TransitionId", key: "TransitionId" },
1834
- { label: "WorkflowId", key: "workflowId" },
1835
- { label: "FromStepId", key: "FromStepId" },
1836
- { label: "ToStepId", key: "ToStepId" },
1837
- { label: "ActionCode", key: "ActionCode" },
1838
- { label: "ActionName", key: "ActionName" }
1839
- ].map((column) => /* @__PURE__ */ jsx14(
1840
- "th",
1841
- {
1842
- onClick: () => handleSort(column.key),
1843
- className: "px-6 py-4 text-left border-b border-gray-200 text-[11px] font-bold uppercase tracking-wider text-slate-500",
1844
- children: /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
1845
- /* @__PURE__ */ jsx14("span", { children: column.label }),
1846
- /* @__PURE__ */ jsx14("span", { className: "text-gray-400 text-xs", children: sortConfig.key === column.key ? sortConfig.direction === "asc" ? "\u25B2" : "\u25BC" : "\u2195" })
1847
- ] })
1848
- },
1849
- column.key
1850
- )) }) }),
1851
- /* @__PURE__ */ jsx14("tbody", { children: WorkflowTransition.slice(0, pageSize).map((item) => /* @__PURE__ */ jsxs13(
1852
- "tr",
1853
- {
1854
- className: "hover:bg-slate-50 transition-colors",
1855
- children: [
1856
- /* @__PURE__ */ jsx14("td", { className: "px-6 p-4 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.TransitionId }),
1857
- /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.workflowId }),
1858
- /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.FromStepId }),
1859
- /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 border-b border-slate-200 text-align center text-[13px] text-slate-500 font-bold", children: item.ToStepId }),
1860
- /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 border-b border-slate-200", children: /* @__PURE__ */ jsx14(
1861
- "span",
1862
- {
1863
- className: `inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold
1718
+ /* @__PURE__ */ jsxs16("div", { className: "border border-slate-200 rounded-2xl overflow-hidden bg-white shadow-md", children: [
1719
+ /* @__PURE__ */ jsx16("div", { className: "max-h-[350px] overflow-y-auto overflow-x-auto", children: /* @__PURE__ */ jsxs16("table", { className: "min-w-max w-full border-collapse", children: [
1720
+ /* @__PURE__ */ jsx16("thead", { className: "bg-slate-50 sticky top-0 z-10", children: /* @__PURE__ */ jsx16("tr", { className: "text-[11px] font-bold uppercase tracking-wider text-slate-400", children: [
1721
+ { label: "TransitionId", key: "TransitionId" },
1722
+ { label: "WorkflowId", key: "workflowId" },
1723
+ { label: "FromStepId", key: "FromStepId" },
1724
+ { label: "ToStepId", key: "ToStepId" },
1725
+ { label: "ActionCode", key: "ActionCode" },
1726
+ { label: "ActionName", key: "ActionName" }
1727
+ ].map((column) => /* @__PURE__ */ jsx16(
1728
+ "th",
1729
+ {
1730
+ onClick: () => handleSort(column.key),
1731
+ className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider cursor-pointer select-none hover:bg-slate-100 transition-colors",
1732
+ children: /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-center gap-2", children: [
1733
+ /* @__PURE__ */ jsx16("span", { children: column.label }),
1734
+ /* @__PURE__ */ jsx16("span", { className: "text-gray-400 text-xs", children: sortConfig.key === column.key ? sortConfig.direction === "asc" ? "\u25B2" : "\u25BC" : "\u2195" })
1735
+ ] })
1736
+ },
1737
+ column.key
1738
+ )) }) }),
1739
+ /* @__PURE__ */ jsx16("tbody", { children: WorkflowTransition.slice(0, pageSize).map((item) => /* @__PURE__ */ jsxs16(
1740
+ "tr",
1741
+ {
1742
+ className: "hover:bg-slate-50/80 transition-colors border-b border-slate-100 last:border-0",
1743
+ children: [
1744
+ /* @__PURE__ */ jsx16("td", { className: "px-6 p-4 text-center text-[14px] text-slate-600 font-bold", children: item.TransitionId }),
1745
+ /* @__PURE__ */ jsx16("td", { className: "px-6 py-4 text-center text-[14px] text-slate-600 font-bold", children: item.workflowId }),
1746
+ /* @__PURE__ */ jsx16("td", { className: "px-6 py-4 text-center text-[14px] text-slate-600 font-bold", children: item.FromStepId }),
1747
+ /* @__PURE__ */ jsx16("td", { className: "px-6 py-4 text-center text-align center text-[14px] text-slate-600 font-bold", children: item.ToStepId }),
1748
+ /* @__PURE__ */ jsx16("td", { className: "px-6 py-4 text-center ", children: /* @__PURE__ */ jsx16(
1749
+ "span",
1750
+ {
1751
+ className: `inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold
1864
1752
  ${item.ActionCode === "APPROVE" ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700"}`,
1865
- children: item.ActionCode
1866
- }
1867
- ) }),
1868
- /* @__PURE__ */ jsx14("td", { className: "px-6 py-4 border-b border-slate-200", children: /* @__PURE__ */ jsx14(
1869
- "span",
1870
- {
1871
- className: `inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold
1753
+ children: item.ActionCode
1754
+ }
1755
+ ) }),
1756
+ /* @__PURE__ */ jsx16("td", { className: "px-6 py-4 text-center ", children: /* @__PURE__ */ jsx16(
1757
+ "span",
1758
+ {
1759
+ className: `inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold
1872
1760
  ${item.ActionName === "APPROVE" ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700"}`,
1873
- children: item.ActionName
1874
- }
1875
- ) })
1876
- ]
1877
- },
1878
- item.TransitionId
1879
- )) })
1761
+ children: item.ActionName
1762
+ }
1763
+ ) })
1764
+ ]
1765
+ },
1766
+ item.TransitionId
1767
+ )) })
1768
+ ] }) }),
1769
+ " "
1880
1770
  ] }),
1881
- /* @__PURE__ */ jsx14("div", { className: "h-5" }),
1882
- /* @__PURE__ */ jsx14(Footer, {}),
1883
- showModal && /* @__PURE__ */ jsx14(AddWorkTransitionStepModal, { onClose: () => setShowModal(false) })
1771
+ /* @__PURE__ */ jsxs16("div", { className: "p-5 sticky bottom-0 bg-white z-10", children: [
1772
+ /* @__PURE__ */ jsx16(Footer, {}),
1773
+ " "
1774
+ ] })
1884
1775
  ] })
1885
1776
  ] }) });
1886
1777
  }
1887
1778
 
1888
1779
  // src/components/Sidebar.jsx
1889
- import { Fragment, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1780
+ import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
1890
1781
  var workflowItems = [
1891
1782
  { name: "Workflow Type", component: "workflowType", icon: RiGitMergeLine },
1892
1783
  { name: "Workflow", component: "workflow", icon: RiNodeTree },
@@ -1894,47 +1785,47 @@ var workflowItems = [
1894
1785
  { name: "Workflow Transition", component: "workflowTransition", icon: RiCornerDownRightLine }
1895
1786
  ];
1896
1787
  var permissionItems = [
1897
- { name: "Task Permission", path: "/WorkflowType", icon: RiUserSettingsLine },
1898
- { name: "Assignment Rule", path: "/WorkflowType", icon: RiFileShieldLine }
1788
+ { name: "Task Permission", path: "/TaskPermissionPage", icon: RiUserSettingsLine },
1789
+ { name: "Assignment Rule", path: "/AssignmentRulePage", icon: RiFileShieldLine }
1899
1790
  ];
1900
1791
  var hierarchyItems = [
1901
- { name: "Hierarchy Node", path: "/WorkflowType", icon: RiNodeTree },
1792
+ { name: "Hierarchy Node", path: "/HierarchyNodePage", icon: RiNodeTree },
1902
1793
  { name: "User Hierarchy Mapping", path: "/WorkflowType", icon: RiUserSharedLine },
1903
- { name: "Workflow Settings", path: "/WorkflowType", icon: RiSettings4Line }
1794
+ { name: "Workflow Settings", path: "/WorkflowSettingPage", icon: RiSettings4Line }
1904
1795
  ];
1905
1796
  var documentItems = [
1906
- { name: "Document Configuration", path: "/WorkflowType", icon: RiFileSettingsLine }
1797
+ { name: "Document Configuration", path: "/DocumentConfiguration", icon: RiFileSettingsLine }
1907
1798
  ];
1908
1799
  var fileItems = [
1909
1800
  { name: "File Instance", path: "/WorkflowType", icon: RiFileList3Line },
1910
- { name: "File Pool", path: "/WorkflowType", icon: RiDatabase2Line },
1911
- { name: "Uploaded Document", path: "/WorkflowType", icon: RiFileUploadLine }
1801
+ { name: "File Pool", path: "/FilePoolPage", icon: RiDatabase2Line },
1802
+ { name: "Uploaded Document", path: "/UploadedDocumentPage", icon: RiFileUploadLine }
1912
1803
  ];
1913
1804
  var communicationItems = [
1914
- { name: "Notification", path: "/WorkflowType", icon: RiNotification4Line },
1805
+ { name: "Notification", path: "/NotificationPage", icon: RiNotification4Line },
1915
1806
  { name: "Comment", path: "/WorkflowType", icon: RiChat3Line }
1916
1807
  ];
1917
1808
  var taskItems = [
1918
- { name: "Task Instance", path: "/WorkflowType", icon: RiCheckboxMultipleLine }
1809
+ { name: "Task Instance", path: "taskinstance", icon: RiCheckboxMultipleLine }
1919
1810
  ];
1920
1811
  var trackingItems = [
1921
- { name: "Audit Log", path: "/WorkflowType", icon: RiShieldCheckLine },
1922
- { name: "Movement History", path: "/WorkflowType", icon: RiHistoryLine }
1812
+ { name: "Audit Log", path: "/AuditLog", icon: RiShieldCheckLine },
1813
+ { name: "Movement History", path: "/MovementHistory", icon: RiHistoryLine }
1923
1814
  ];
1924
- function Sidebar({ isOpen, onToggle, children }) {
1815
+ function Sidebar({ isOpen, onToggle, childrens }) {
1925
1816
  const router = useRouter();
1926
- const [workflowOpen, setWorkflowOpen] = useState8(false);
1927
- const [permissionOpen, setPermissionOpen] = useState8(false);
1928
- const [hierarchyOpen, setHierarchyOpen] = useState8(false);
1929
- const [documentOpen, setDocumentOpen] = useState8(false);
1930
- const [filesOpen, setFilesOpen] = useState8(false);
1931
- const [tasksOpen, setTasksOpen] = useState8(false);
1932
- const [trackingOpen, setTrackingOpen] = useState8(false);
1933
- const [communicationOpen, setCommunicationOpen] = useState8(false);
1934
- const [activeComponent, setActiveComponent] = useState8("workflowType");
1817
+ const [workflowOpen, setWorkflowOpen] = useState7(false);
1818
+ const [permissionOpen, setPermissionOpen] = useState7(false);
1819
+ const [hierarchyOpen, setHierarchyOpen] = useState7(false);
1820
+ const [documentOpen, setDocumentOpen] = useState7(false);
1821
+ const [filesOpen, setFilesOpen] = useState7(false);
1822
+ const [tasksOpen, setTasksOpen] = useState7(false);
1823
+ const [trackingOpen, setTrackingOpen] = useState7(false);
1824
+ const [communicationOpen, setCommunicationOpen] = useState7(false);
1825
+ const [activeComponent, setActiveComponent] = useState7("workflowType");
1935
1826
  const renderMenuItemold = (item) => {
1936
1827
  const Icon = item.icon;
1937
- return /* @__PURE__ */ jsxs14(
1828
+ return /* @__PURE__ */ jsxs17(
1938
1829
  "button",
1939
1830
  {
1940
1831
  type: "button",
@@ -1946,14 +1837,14 @@ function Sidebar({ isOpen, onToggle, children }) {
1946
1837
  `,
1947
1838
  onClick: () => router.push(item.path),
1948
1839
  children: [
1949
- /* @__PURE__ */ jsx15(
1840
+ /* @__PURE__ */ jsx17(
1950
1841
  "span",
1951
1842
  {
1952
1843
  className: "\r\n flex h-[20px] w-[20px] shrink-0\r\n items-center justify-center\r\n rounded-[6px] text-[#405170]\r\n ",
1953
- children: /* @__PURE__ */ jsx15(Icon, { size: 17 })
1844
+ children: /* @__PURE__ */ jsx17(Icon, { size: 17 })
1954
1845
  }
1955
1846
  ),
1956
- /* @__PURE__ */ jsx15("span", { className: "whitespace-nowrap text-[14px] font-medium leading-[22px]", children: item.name })
1847
+ /* @__PURE__ */ jsx17("span", { className: "whitespace-nowrap text-[14px] font-medium leading-[22px]", children: item.name })
1957
1848
  ]
1958
1849
  },
1959
1850
  item.name
@@ -1963,13 +1854,14 @@ function Sidebar({ isOpen, onToggle, children }) {
1963
1854
  const Icon = item.icon;
1964
1855
  const handleClick = () => {
1965
1856
  if (item.component) {
1857
+ router.push("/", void 0, { shallow: true });
1966
1858
  setActiveComponent(item.component);
1967
- } else {
1859
+ } else if (item.path) {
1968
1860
  setActiveComponent(null);
1969
1861
  router.push(item.path);
1970
1862
  }
1971
1863
  };
1972
- return /* @__PURE__ */ jsxs14(
1864
+ return /* @__PURE__ */ jsxs17(
1973
1865
  "button",
1974
1866
  {
1975
1867
  onClick: handleClick,
@@ -1979,8 +1871,8 @@ function Sidebar({ isOpen, onToggle, children }) {
1979
1871
  ${item.component ? activeComponent === item.component ? "bg-blue-50 text-blue-600" : "text-[#344261] hover:bg-[#F6F8FC]" : router.pathname === item.path ? "bg-blue-50 text-blue-600" : "text-[#344261] hover:bg-[#F6F8FC]"}
1980
1872
  `,
1981
1873
  children: [
1982
- /* @__PURE__ */ jsx15(Icon, { size: 17 }),
1983
- /* @__PURE__ */ jsx15("span", { children: item.name })
1874
+ /* @__PURE__ */ jsx17(Icon, { size: 17 }),
1875
+ /* @__PURE__ */ jsx17("span", { children: item.name })
1984
1876
  ]
1985
1877
  },
1986
1878
  item.name
@@ -1989,36 +1881,36 @@ function Sidebar({ isOpen, onToggle, children }) {
1989
1881
  const renderContent = () => {
1990
1882
  switch (activeComponent) {
1991
1883
  case "workflowType":
1992
- return /* @__PURE__ */ jsx15(WorkflowTypeMains, {});
1884
+ return /* @__PURE__ */ jsx17(WorkflowTypeMains, {});
1993
1885
  case "workflow":
1994
- return /* @__PURE__ */ jsx15(WorkflowMasterMain, {});
1886
+ return /* @__PURE__ */ jsx17(WorkflowPage, {});
1995
1887
  case "workflowStep":
1996
- return /* @__PURE__ */ jsx15(WorkflowStep, {});
1888
+ return /* @__PURE__ */ jsx17(WorkflowStep, {});
1997
1889
  case "workflowTransition":
1998
- return /* @__PURE__ */ jsx15(WorkFlowTransition, {});
1890
+ return /* @__PURE__ */ jsx17(WorkFlowTransition, {});
1999
1891
  default:
2000
- return children;
1892
+ return childrens;
2001
1893
  }
2002
1894
  };
2003
1895
  const renderDropdown = (title, open, setOpen, items) => {
2004
- return /* @__PURE__ */ jsxs14("div", { className: "mb-2", children: [
2005
- /* @__PURE__ */ jsxs14(
1896
+ return /* @__PURE__ */ jsxs17("div", { className: "mb-2", children: [
1897
+ /* @__PURE__ */ jsxs17(
2006
1898
  "button",
2007
1899
  {
2008
1900
  type: "button",
2009
1901
  onClick: () => setOpen(!open),
2010
1902
  className: "\r\n flex h-[50px] w-full items-center justify-between\r\n rounded-[9px] px-[17px]\r\n text-left text-[#344261]\r\n transition-colors duration-150\r\n hover:bg-[#F6F8FC]\r\n ",
2011
1903
  children: [
2012
- /* @__PURE__ */ jsx15("span", { className: "text-[16px] font-semibold", children: title }),
2013
- open ? /* @__PURE__ */ jsx15(RiArrowDownSLine, { size: 18 }) : /* @__PURE__ */ jsx15(RiArrowRightSLine, { size: 18 })
1904
+ /* @__PURE__ */ jsx17("span", { className: "text-[16px] font-semibold", children: title }),
1905
+ open ? /* @__PURE__ */ jsx17(RiArrowDownSLine, { size: 18 }) : /* @__PURE__ */ jsx17(RiArrowRightSLine, { size: 18 })
2014
1906
  ]
2015
1907
  }
2016
1908
  ),
2017
- open && /* @__PURE__ */ jsx15("div", { className: "ml-[8px] border-l border-[#E5E9F1] pl-[4px]", children: items.map(renderMenuItem) })
1909
+ open && /* @__PURE__ */ jsx17("div", { className: "ml-[8px] border-l border-[#E5E9F1] pl-[4px]", children: items.map(renderMenuItem) })
2018
1910
  ] });
2019
1911
  };
2020
- return /* @__PURE__ */ jsxs14(Fragment, { children: [
2021
- /* @__PURE__ */ jsxs14(
1912
+ return /* @__PURE__ */ jsxs17(Fragment2, { children: [
1913
+ /* @__PURE__ */ jsxs17(
2022
1914
  "aside",
2023
1915
  {
2024
1916
  className: `
@@ -2026,16 +1918,16 @@ function Sidebar({ isOpen, onToggle, children }) {
2026
1918
  border-r border-[#E5E9F1] bg-white
2027
1919
  font-sans text-[#273657]
2028
1920
  transition-all duration-300 ease-in-out
2029
- ${isOpen ? "w-[245px] min-w-[245px] translate-x-0 opacity-100" : "w-0 min-w-0 -translate-x-full opacity-0"}
1921
+ ${isOpen ? "w-[310px] min-w-[310px] translate-x-0 opacity-100" : "w-0 min-w-0 -translate-x-full opacity-0"}
2030
1922
  `,
2031
1923
  children: [
2032
- /* @__PURE__ */ jsxs14(
1924
+ /* @__PURE__ */ jsxs17(
2033
1925
  "header",
2034
1926
  {
2035
1927
  className: "\r\n flex h-[84px] items-center justify-between\r\n border-b border-[#EDF0F5]\r\n px-[14px]\r\n ",
2036
1928
  children: [
2037
- /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2", children: [
2038
- /* @__PURE__ */ jsxs14(
1929
+ /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
1930
+ /* @__PURE__ */ jsxs17(
2039
1931
  "svg",
2040
1932
  {
2041
1933
  width: "36",
@@ -2043,28 +1935,28 @@ function Sidebar({ isOpen, onToggle, children }) {
2043
1935
  viewBox: "0 0 48 56",
2044
1936
  fill: "none",
2045
1937
  children: [
2046
- /* @__PURE__ */ jsx15(
1938
+ /* @__PURE__ */ jsx17(
2047
1939
  "path",
2048
1940
  {
2049
1941
  d: "M24 2L45 12.5L24 23L3 12.5L24 2Z",
2050
1942
  fill: "#356AF3"
2051
1943
  }
2052
1944
  ),
2053
- /* @__PURE__ */ jsx15(
1945
+ /* @__PURE__ */ jsx17(
2054
1946
  "path",
2055
1947
  {
2056
1948
  d: "M24 8L34 13L24 18L14 13L24 8Z",
2057
1949
  fill: "white"
2058
1950
  }
2059
1951
  ),
2060
- /* @__PURE__ */ jsx15(
1952
+ /* @__PURE__ */ jsx17(
2061
1953
  "path",
2062
1954
  {
2063
1955
  d: "M3 20L24 30.5L45 20V27L24 37.5L3 27V20Z",
2064
1956
  fill: "#356AF3"
2065
1957
  }
2066
1958
  ),
2067
- /* @__PURE__ */ jsx15(
1959
+ /* @__PURE__ */ jsx17(
2068
1960
  "path",
2069
1961
  {
2070
1962
  d: "M3 33L24 43.5L45 33V40L24 50.5L3 40V33Z",
@@ -2074,36 +1966,36 @@ function Sidebar({ isOpen, onToggle, children }) {
2074
1966
  ]
2075
1967
  }
2076
1968
  ),
2077
- /* @__PURE__ */ jsxs14("div", { children: [
2078
- /* @__PURE__ */ jsx15("h1", { className: "text-[18px] font-extrabold text-[#101318]", children: "FLOWCORE" }),
2079
- /* @__PURE__ */ jsx15("p", { className: "text-[12px] text-[#344261]", children: "Workflow Engine" })
1969
+ /* @__PURE__ */ jsxs17("div", { children: [
1970
+ /* @__PURE__ */ jsx17("h1", { className: "text-[18px] font-extrabold text-[#101318]", children: "FLOWCORE" }),
1971
+ /* @__PURE__ */ jsx17("p", { className: "text-[12px] text-[#344261]", children: "Workflow Engine" })
2080
1972
  ] })
2081
1973
  ] }),
2082
- /* @__PURE__ */ jsx15(
1974
+ /* @__PURE__ */ jsx17(
2083
1975
  "button",
2084
1976
  {
2085
1977
  type: "button",
2086
1978
  onClick: onToggle,
2087
1979
  className: "\r\n flex h-8 w-8\r\n items-center justify-center\r\n rounded-lg\r\n hover:bg-gray-100\r\n ",
2088
- children: /* @__PURE__ */ jsx15(RiMenuLine, { size: 18 })
1980
+ children: /* @__PURE__ */ jsx17(RiMenuLine, { size: 18 })
2089
1981
  }
2090
1982
  )
2091
1983
  ]
2092
1984
  }
2093
1985
  ),
2094
- /* @__PURE__ */ jsxs14(
1986
+ /* @__PURE__ */ jsxs17(
2095
1987
  "div",
2096
1988
  {
2097
1989
  className: "\r\n min-h-0 flex-1\r\n overflow-y-auto overflow-x-hidden\r\n px-[27px] pb-[30px] pt-[31px]\r\n ",
2098
1990
  children: [
2099
- /* @__PURE__ */ jsx15(
1991
+ /* @__PURE__ */ jsx17(
2100
1992
  "p",
2101
1993
  {
2102
1994
  className: "\r\n mb-[19px] ml-[15px]\r\n text-[14px] font-bold uppercase\r\n leading-[20px] tracking-[0.2px]\r\n text-[#3C4D74]\r\n ",
2103
1995
  children: "Configuration Masters"
2104
1996
  }
2105
1997
  ),
2106
- /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-[3px]", children: [
1998
+ /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-[3px]", children: [
2107
1999
  renderDropdown(
2108
2000
  "Workflow",
2109
2001
  workflowOpen,
@@ -2129,14 +2021,14 @@ function Sidebar({ isOpen, onToggle, children }) {
2129
2021
  hierarchyItems
2130
2022
  )
2131
2023
  ] }),
2132
- /* @__PURE__ */ jsx15(
2024
+ /* @__PURE__ */ jsx17(
2133
2025
  "p",
2134
2026
  {
2135
2027
  className: "\r\n mb-[19px] ml-[15px] mt-[39px]\r\n text-[14px] font-bold uppercase\r\n leading-[20px] tracking-[0.2px]\r\n text-[#3C4D74]\r\n ",
2136
2028
  children: "Runtime"
2137
2029
  }
2138
2030
  ),
2139
- /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-[3px]", children: [
2031
+ /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-[3px]", children: [
2140
2032
  renderDropdown(
2141
2033
  "Files",
2142
2034
  filesOpen,
@@ -2165,18 +2057,18 @@ function Sidebar({ isOpen, onToggle, children }) {
2165
2057
  ]
2166
2058
  }
2167
2059
  ),
2168
- /* @__PURE__ */ jsx15(
2060
+ /* @__PURE__ */ jsx17(
2169
2061
  "div",
2170
2062
  {
2171
2063
  className: "\r\n shrink-0\r\n bg-white\r\n px-[27px]\r\n pb-[34px]\r\n pt-[18px]\r\n ",
2172
- children: /* @__PURE__ */ jsxs14(
2064
+ children: /* @__PURE__ */ jsxs17(
2173
2065
  "button",
2174
2066
  {
2175
2067
  type: "button",
2176
2068
  className: "\r\n flex h-[66px] w-full\r\n items-center gap-[18px]\r\n rounded-[10px]\r\n border border-[#E1E5ED]\r\n bg-white\r\n px-[23px]\r\n text-left\r\n text-[16px]\r\n font-semibold\r\n text-[#2D3A58]\r\n shadow-sm\r\n hover:bg-[#F7F8FC]\r\n transition\r\n ",
2177
2069
  children: [
2178
- /* @__PURE__ */ jsx15(RiSettings4Line, { size: 20 }),
2179
- /* @__PURE__ */ jsx15("span", { children: "Settings" })
2070
+ /* @__PURE__ */ jsx17(RiSettings4Line, { size: 20 }),
2071
+ /* @__PURE__ */ jsx17("span", { children: "Settings" })
2180
2072
  ]
2181
2073
  }
2182
2074
  )
@@ -2185,26 +2077,41 @@ function Sidebar({ isOpen, onToggle, children }) {
2185
2077
  ]
2186
2078
  }
2187
2079
  ),
2188
- /* @__PURE__ */ jsx15("div", { className: "flex-1 overflow-auto bg-[#F5F7FB]", children: renderContent() }),
2189
- !isOpen && /* @__PURE__ */ jsx15(
2080
+ /* @__PURE__ */ jsx17("div", { className: "flex-1 overflow-auto bg-[#F5F7FB]", children: renderContent() }),
2081
+ !isOpen && /* @__PURE__ */ jsx17(
2190
2082
  "button",
2191
2083
  {
2192
2084
  type: "button",
2193
2085
  onClick: onToggle,
2194
2086
  "aria-label": "Open sidebar",
2195
2087
  className: "\r\n fixed left-[20px] top-[30px] z-[100]\r\n flex h-[46px] w-[46px]\r\n items-center justify-center\r\n rounded-[9px]\r\n border border-[#E1E5ED]\r\n bg-white text-[#344261]\r\n shadow-[0_2px_8px_rgba(0,0,0,0.08)]\r\n transition-colors\r\n hover:bg-[#F3F5F9]\r\n ",
2196
- children: /* @__PURE__ */ jsx15(RiMenuLine, { size: 18 })
2088
+ children: /* @__PURE__ */ jsx17(RiMenuLine, { size: 18 })
2197
2089
  }
2198
2090
  )
2199
2091
  ] });
2200
2092
  }
2201
2093
 
2094
+ // src/components/Service/ApiEndpointsProvider.js
2095
+ var STORAGE_KEY = "FLOWCORE_API_ENDPOINTS";
2096
+ var apiEndpoints = null;
2097
+ var ApiEndpointsProvider = ({ apiEndpoints: endpoints }) => {
2098
+ if (typeof window !== "undefined" && endpoints) {
2099
+ apiEndpoints = endpoints;
2100
+ sessionStorage.setItem(
2101
+ STORAGE_KEY,
2102
+ JSON.stringify(endpoints)
2103
+ );
2104
+ }
2105
+ return null;
2106
+ };
2107
+ var ApiEndpointsProvider_default = ApiEndpointsProvider;
2108
+
2202
2109
  // src/components/Layout.jsx
2203
- import { useState as useState9 } from "react";
2204
- import { jsx as jsx16 } from "react/jsx-runtime";
2110
+ import { useState as useState8 } from "react";
2111
+ import { jsx as jsx18 } from "react/jsx-runtime";
2205
2112
  var Layout = ({ children }) => {
2206
- const [isOpen, setIsOpen] = useState9(true);
2207
- return /* @__PURE__ */ jsx16("div", { className: "flex min-h-screen", children: /* @__PURE__ */ jsx16(
2113
+ const [isOpen, setIsOpen] = useState8(true);
2114
+ return /* @__PURE__ */ jsx18("div", { className: "flex min-h-screen", children: /* @__PURE__ */ jsx18(
2208
2115
  Sidebar,
2209
2116
  {
2210
2117
  isOpen,
@@ -2215,6 +2122,7 @@ var Layout = ({ children }) => {
2215
2122
  };
2216
2123
  var Layout_default = Layout;
2217
2124
  export {
2125
+ ApiEndpointsProvider_default as ApiEndpointsProvider,
2218
2126
  Layout_default as Layout,
2219
2127
  Sidebar,
2220
2128
  WorkflowPage