flowcore-fn 2.9.3 → 2.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pkg-index.js CHANGED
@@ -1,10 +1,27 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
9
  var __getProtoOf = Object.getPrototypeOf;
7
10
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8
25
  var __export = (target, all) => {
9
26
  for (var name in all)
10
27
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -30,9 +47,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
47
  // src/pkg-index.jsx
31
48
  var pkg_index_exports = {};
32
49
  __export(pkg_index_exports, {
33
- AdminPanel: () => AdminPanel_default,
34
50
  Layout: () => Layout_default,
35
- Sidebar: () => Home,
51
+ Sidebar: () => Sidebar,
36
52
  WorkflowPage: () => WorkflowPage
37
53
  });
38
54
  module.exports = __toCommonJS(pkg_index_exports);
@@ -46,10 +62,15 @@ var import_jsx_runtime = require("react/jsx-runtime");
46
62
  function Footer() {
47
63
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex justify-between items-center px-6 py-4 border-t border-gray-200 bg-white", children: [
48
64
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm text-slate-500", children: "Showing 1 to 5 of 5 entries" }),
49
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-1.5", children: [
50
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "px-3 py-1.5 border border-slate-200 rounded-lg bg-white text-slate-600 hover:bg-slate-50 shadow-sm", children: "\u2039" }),
51
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "px-3.5 py-1.5 bg-blue-600 text-white rounded-lg font-bold shadow-md shadow-blue-500/20", children: "1" }),
52
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "px-3 py-1.5 border border-slate-200 rounded-lg bg-white text-slate-600 hover:bg-slate-50 shadow-sm", children: "\u203A" })
65
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
66
+ /* @__PURE__ */ (0, import_jsx_runtime.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" }),
67
+ /* @__PURE__ */ (0, import_jsx_runtime.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" }),
68
+ /* @__PURE__ */ (0, import_jsx_runtime.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" }),
69
+ /* @__PURE__ */ (0, import_jsx_runtime.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" }),
70
+ /* @__PURE__ */ (0, import_jsx_runtime.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" }),
71
+ /* @__PURE__ */ (0, import_jsx_runtime.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" }),
72
+ /* @__PURE__ */ (0, import_jsx_runtime.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" }),
73
+ /* @__PURE__ */ (0, import_jsx_runtime.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" })
53
74
  ] })
54
75
  ] });
55
76
  }
@@ -57,7 +78,7 @@ function Footer() {
57
78
  // src/components/WorkflowStep/main.js
58
79
  var import_link = __toESM(require("next/link"));
59
80
 
60
- // src/components/AddWorkflowStepModal.js
81
+ // src/components/WorkflowStep/AddWorkflowStepModal.js
61
82
  var import_react2 = __toESM(require("react"));
62
83
  var import_jsx_runtime2 = require("react/jsx-runtime");
63
84
  function AddWorkflowStepModal({ onClose }) {
@@ -351,6 +372,21 @@ var workflowSteps = [
351
372
  ];
352
373
  function WorkflowStep() {
353
374
  const [showModal, setShowModal] = (0, import_react3.useState)(false);
375
+ const [pageSize, setPageSize] = (0, import_react3.useState)(5);
376
+ const [sortConfig, setSortConfig] = (0, import_react3.useState)({
377
+ key: "",
378
+ direction: "asc"
379
+ });
380
+ const handleSort = (key) => {
381
+ let direction = "asc";
382
+ if (sortConfig.key === key && sortConfig.direction === "asc") {
383
+ direction = "desc";
384
+ }
385
+ setSortConfig({
386
+ key,
387
+ direction
388
+ });
389
+ };
354
390
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "p-6 bg-[#f5f7fb] min-h-screen font-sans text-slate-700", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "bg-white rounded-2xl shadow-md overflow-hidden", children: [
355
391
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "px-6 py-5 border-b border-gray-200", children: [
356
392
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h1", { className: "m-0 text-[30px] leading-tight font-semibold text-[#1E293B] tracking-tight", children: "Workflow Step" }),
@@ -373,38 +409,59 @@ function WorkflowStep() {
373
409
  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"
374
410
  }
375
411
  ),
412
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: [
413
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Show" }),
414
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
415
+ "select",
416
+ {
417
+ value: pageSize,
418
+ onChange: (e) => setPageSize(Number(e.target.value)),
419
+ className: "inline-flex item-center px-3 py-1 rounded-md bg-[#f1f5f9] text-[#334155] text-xs font-semibold border border-[#e2e8f0]",
420
+ children: [
421
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: 5, children: "5" }),
422
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: 10, children: "10" }),
423
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: 25, children: "25" })
424
+ ]
425
+ }
426
+ ),
427
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "entries" })
428
+ ] }),
376
429
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
377
430
  "button",
378
431
  {
379
432
  onClick: () => setShowModal(true),
380
433
  className: "px-5 py-2.5 bg-blue-600 text-white rounded-lg text-[13px] font-semibold hover:bg-blue-700 transition-colors",
381
- children: "+ Add Workflow Type"
434
+ children: "+ Add Workflow Step"
382
435
  }
383
436
  )
384
437
  ] }) }),
385
438
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "overflow-x-auto", children: [
386
439
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("table", { className: "w-full border-collapse", children: [
387
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("tr", { className: "bg-slate-50/70 border-b border-slate-200 text-[11px] font-bold uppercase tracking-wider text-slate-500", children: [
388
- "WorkflowStepId",
389
- "WorkflowId",
390
- "StepCode",
391
- "StepName",
392
- "SequenceNo",
393
- "SLA Type",
394
- "SLA Value",
395
- "Reminder Before",
396
- "Escalation After",
397
- "Working Hours Only",
398
- "Exclude Holidays"
399
- ].map((heading) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
440
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("tr", { className: "bg-slate-50/70 border-b border-slate-200 text-xs font-bold uppercase tracking-wider text-slate-500", children: [
441
+ { label: "WorkflowStepId", key: "workflowStepId" },
442
+ { label: "WorkflowId", key: "workflowId" },
443
+ { label: "StepCode", key: "stepCode" },
444
+ { label: "StepName", key: "stepName" },
445
+ { label: "SequenceNo", key: "sequenceNo" },
446
+ { label: "SLA Type", key: "slaType" },
447
+ { label: "SLA Value", key: "slaValue" },
448
+ { label: "Reminder Before", key: "reminderBefore" },
449
+ { label: "Escalation After", key: "escalationAfter" },
450
+ { label: "Working Hours Only", key: "workingHoursOnly" },
451
+ { label: "Exclude Holidays", key: "excludeHolidays" }
452
+ ].map((column) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
400
453
  "th",
401
454
  {
455
+ onClick: () => handleSort(column.key),
402
456
  className: "px-4 py-3 text-left border-b border-gray-200 text-[11px] font-bold uppercase tracking-wider text-slate-500",
403
- children: heading
457
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-2", children: [
458
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: column.label }),
459
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-gray-400 text-xs", children: sortConfig.key === column.key ? sortConfig.direction === "asc" ? "\u25B2" : "\u25BC" : "\u2195" })
460
+ ] })
404
461
  },
405
- heading
462
+ column.key
406
463
  )) }) }),
407
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("tbody", { children: workflowSteps.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
464
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("tbody", { children: workflowSteps.slice(0, pageSize).map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
408
465
  "tr",
409
466
  {
410
467
  className: "hover:bg-slate-50 transition-colors",
@@ -438,189 +495,1629 @@ function WorkflowPage() {
438
495
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(WorkflowStep, {});
439
496
  }
440
497
 
441
- // src/pages/Sidebar.js
442
- var import_react6 = require("react");
443
-
444
498
  // src/components/Sidebar.jsx
445
- var import_react4 = require("react");
446
- var import_react5 = require("@remixicon/react");
499
+ var import_react14 = require("react");
500
+ var import_react15 = require("@remixicon/react");
447
501
  var import_router = require("next/router");
502
+
503
+ // src/components/workflowMaster/workFlowMasterMain.js
504
+ var import_react5 = require("react");
505
+
506
+ // src/components/workflowMaster/workflowTable.jsx
507
+ var import_react4 = require("react");
448
508
  var import_jsx_runtime5 = require("react/jsx-runtime");
449
- var workflowItems = [
450
- { name: "Workflow Type", path: "/WorkflowType", icon: import_react5.RiGitMergeLine },
451
- { name: "Workflow", path: "/workflow", icon: import_react5.RiNodeTree },
452
- { name: "Workflow Step", path: "/workflowMaster", icon: import_react5.RiGitBranchLine },
453
- { name: "Workflow Transition", path: "/TaskPermissionPage", icon: import_react5.RiCornerDownRightLine }
454
- ];
455
- var permissionItems = [
456
- { name: "Task Permission", path: "/WorkflowType", icon: import_react5.RiUserSettingsLine },
457
- { name: "Assignment Rule", path: "/WorkflowType", icon: import_react5.RiFileShieldLine }
458
- ];
459
- var hierarchyItems = [
460
- { name: "Hierarchy Node", path: "/WorkflowType", icon: import_react5.RiNodeTree },
461
- { name: "User Hierarchy Mapping", path: "/WorkflowType", icon: import_react5.RiUserSharedLine },
462
- { name: "Workflow Settings", path: "/WorkflowType", icon: import_react5.RiSettings4Line }
463
- ];
464
- var documentItems = [
465
- { name: "Document Configuration", path: "/WorkflowType", icon: import_react5.RiFileSettingsLine }
466
- ];
467
- var fileItems = [
468
- { name: "File Instance", path: "/WorkflowType", icon: import_react5.RiFileList3Line },
469
- { name: "File Pool", path: "/WorkflowType", icon: import_react5.RiDatabase2Line },
470
- { name: "Uploaded Document", path: "/WorkflowType", icon: import_react5.RiFileUploadLine }
471
- ];
472
- var communicationItems = [
473
- { name: "Notification", path: "/WorkflowType", icon: import_react5.RiNotification4Line },
474
- { name: "Comment", path: "/WorkflowType", icon: import_react5.RiChat3Line }
475
- ];
476
- var taskItems = [
477
- { name: "Task Instance", path: "/WorkflowType", icon: import_react5.RiCheckboxMultipleLine }
478
- ];
479
- var trackingItems = [
480
- { name: "Audit Log", path: "/WorkflowType", icon: import_react5.RiShieldCheckLine },
481
- { name: "Movement History", path: "/WorkflowType", icon: import_react5.RiHistoryLine }
482
- ];
483
- function Sidebar({ isOpen, onToggle }) {
484
- const router = (0, import_router.useRouter)();
485
- const [workflowOpen, setWorkflowOpen] = (0, import_react4.useState)(false);
486
- const [permissionOpen, setPermissionOpen] = (0, import_react4.useState)(false);
487
- const [hierarchyOpen, setHierarchyOpen] = (0, import_react4.useState)(false);
488
- const [documentOpen, setDocumentOpen] = (0, import_react4.useState)(false);
489
- const [filesOpen, setFilesOpen] = (0, import_react4.useState)(false);
490
- const [tasksOpen, setTasksOpen] = (0, import_react4.useState)(false);
491
- const [trackingOpen, setTrackingOpen] = (0, import_react4.useState)(false);
492
- const [communicationOpen, setCommunicationOpen] = (0, import_react4.useState)(false);
493
- const renderMenuItem = (item) => {
494
- const Icon = item.icon;
495
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
496
- "button",
497
- {
498
- type: "button",
499
- className: `
500
- flex h-[56px] w-full items-center gap-[17px]
501
- rounded-[9px] px-[17px]
502
- text-left transition-colors duration-150
503
- ${router.pathname === item.path ? "bg-blue-50 text-blue-600" : "text-[#344261] hover:bg-[#F6F8FC]"}
504
- `,
505
- onClick: () => router.push(item.path),
506
- children: [
509
+ function WorkflowTable({
510
+ search = "",
511
+ workflows = [],
512
+ workflowtoggle,
513
+ entriesPerPage,
514
+ setEntriesPerPage
515
+ }) {
516
+ const [sortField, setSortField] = (0, import_react4.useState)("");
517
+ const [sortDirection, setSortDirection] = (0, import_react4.useState)("asc");
518
+ const [currentPage, setCurrentPage] = (0, import_react4.useState)(100);
519
+ (0, import_react4.useEffect)(() => {
520
+ setCurrentPage(100);
521
+ }, [search]);
522
+ const handleSort = (field) => {
523
+ if (sortField === field) {
524
+ setSortDirection(sortDirection === "asc" ? "desc" : "asc");
525
+ } else {
526
+ setSortField(field);
527
+ setSortDirection("asc");
528
+ }
529
+ };
530
+ const filteredworkflows = workflows.filter(
531
+ (workflow) => {
532
+ var _a, _b;
533
+ 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()));
534
+ }
535
+ );
536
+ const sortedWorkflows = [...filteredworkflows].sort((a, b) => {
537
+ if (!sortField) return 0;
538
+ let valA = a[sortField] !== void 0 && a[sortField] !== null ? a[sortField].toString().toLowerCase() : "";
539
+ let valB = b[sortField] !== void 0 && b[sortField] !== null ? b[sortField].toString().toLowerCase() : "";
540
+ if (sortField === "version") {
541
+ valA = Number(a[sortField]) || 0;
542
+ valB = Number(b[sortField]) || 0;
543
+ }
544
+ if (valA < valB) return sortDirection === "asc" ? -1 : 1;
545
+ if (valA > valB) return sortDirection === "asc" ? 1 : -1;
546
+ return 0;
547
+ });
548
+ const totalEntries = sortedWorkflows.length;
549
+ const totalPages = Math.ceil(totalEntries / (entriesPerPage || 10)) || 1;
550
+ const activePage = currentPage > totalPages ? 1 : currentPage;
551
+ const indexOfLastEntry = activePage * (entriesPerPage || 10);
552
+ const indexOfFirstEntry = indexOfLastEntry - (entriesPerPage || 10);
553
+ const currentDisplayedWorkflows = sortedWorkflows.slice(indexOfFirstEntry, indexOfLastEntry);
554
+ const renderSortIcon = (field) => {
555
+ if (sortField !== field) {
556
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { className: "w-3.5 h-3.5 text-slate-300", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" }) });
557
+ }
558
+ return sortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { className: "w-3.5 h-3.5 text-blue-600", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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__ */ (0, import_jsx_runtime5.jsx)("svg", { className: "w-3.5 h-3.5 text-blue-600", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" }) });
559
+ };
560
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "space-y-6", children: [
561
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "border border-slate-100 rounded-2xl overflow-hidden bg-white shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("table", { className: "w-full border-collapse", children: [
562
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("thead", { className: "bg-[#f8fafc]", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("tr", { children: [
563
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider w-20", children: "S.No" }),
564
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
565
+ "th",
566
+ {
567
+ onClick: () => handleSort("name"),
568
+ 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",
569
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-1.5", children: [
570
+ "Workflow Name ",
571
+ renderSortIcon("name")
572
+ ] })
573
+ }
574
+ ),
575
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
576
+ "th",
577
+ {
578
+ onClick: () => handleSort("workflowcode"),
579
+ 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",
580
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-1.5", children: [
581
+ "Workflow Code ",
582
+ renderSortIcon("workflowcode")
583
+ ] })
584
+ }
585
+ ),
586
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
587
+ "th",
588
+ {
589
+ onClick: () => handleSort("workflowtype"),
590
+ 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",
591
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-1.5", children: [
592
+ "Workflow Type ",
593
+ renderSortIcon("workflowtype")
594
+ ] })
595
+ }
596
+ ),
597
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
598
+ "th",
599
+ {
600
+ onClick: () => handleSort("version"),
601
+ 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",
602
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-1.5", children: [
603
+ "Version ",
604
+ renderSortIcon("version")
605
+ ] })
606
+ }
607
+ ),
608
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { className: "px-6 py-4 text-center text-xs font-bold text-slate-500 uppercase tracking-wider w-32", children: "Published" }),
609
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { className: "px-6 py-4 text-center text-xs font-bold text-slate-500 uppercase tracking-wider w-32", children: "Status" })
610
+ ] }) }),
611
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("tbody", { className: "divide-y divide-slate-100", children: currentDisplayedWorkflows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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__ */ (0, import_jsx_runtime5.jsxs)("tr", { className: "hover:bg-slate-50/50 transition", children: [
612
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: "px-6 py-4 text-sm text-slate-400 font-medium", children: indexOfFirstEntry + index + 1 }),
613
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: "px-6 py-4 text-sm font-semibold text-slate-800", children: workflow.name }),
614
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: "px-6 py-4 text-sm text-slate-500 font-medium", children: workflow.workflowcode }),
615
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: "px-6 py-4 text-sm text-slate-500 font-medium", children: workflow.workflowtype }),
616
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: "px-6 py-4 text-sm text-slate-800 font-bold", children: workflow.version }),
617
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: "px-6 py-4 text-center", children: (() => {
618
+ var _a;
619
+ const isPublished = ((_a = workflow == null ? void 0 : workflow.published) == null ? void 0 : _a.toString().toLowerCase()) === "yes" || (workflow == null ? void 0 : workflow.published) === true;
620
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" });
621
+ })() }),
622
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: "px-6 py-4 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "relative inline-flex items-center cursor-pointer group", children: [
507
623
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
508
- "span",
624
+ "input",
509
625
  {
510
- className: "\r\n flex h-[20px] w-[20px] shrink-0\r\n items-center justify-center\r\n rounded-[6px] text-[#405170]\r\n ",
511
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { size: 17 })
626
+ type: "checkbox",
627
+ checked: workflow.status || false,
628
+ onChange: () => workflowtoggle && workflowtoggle(workflow.id),
629
+ className: "sr-only peer"
512
630
  }
513
631
  ),
514
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "whitespace-nowrap text-[14px] font-medium leading-[22px]", children: item.name })
515
- ]
516
- },
517
- item.name
518
- );
519
- };
520
- const renderDropdown = (title, open, setOpen, items) => {
521
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "mb-2", children: [
522
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
632
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" })
633
+ ] }) }) })
634
+ ] }, workflow.id)) })
635
+ ] }) }),
636
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-1", children: [
637
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
523
638
  "button",
524
639
  {
525
- type: "button",
526
- onClick: () => setOpen(!open),
527
- 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 ",
528
- children: [
529
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-[16px] font-semibold", children: title }),
530
- open ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react5.RiArrowDownSLine, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react5.RiArrowRightSLine, { size: 18 })
531
- ]
640
+ onClick: () => setCurrentPage(1),
641
+ disabled: activePage === 1,
642
+ 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"}`,
643
+ children: "First"
532
644
  }
533
645
  ),
534
- open && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "ml-[8px] border-l border-[#E5E9F1] pl-[4px]", children: items.map(renderMenuItem) })
535
- ] });
646
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
647
+ "button",
648
+ {
649
+ onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)),
650
+ disabled: activePage === 1,
651
+ 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"}`,
652
+ children: "\u2039 Prev"
653
+ }
654
+ ),
655
+ Array.from({ length: totalPages }, (_, index) => {
656
+ const pageNum = index + 1;
657
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
658
+ "button",
659
+ {
660
+ onClick: () => setCurrentPage(pageNum),
661
+ 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"}`,
662
+ children: pageNum
663
+ },
664
+ pageNum
665
+ );
666
+ }),
667
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
668
+ "button",
669
+ {
670
+ onClick: () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)),
671
+ disabled: activePage === totalPages,
672
+ 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"}`,
673
+ children: "Next \u203A"
674
+ }
675
+ ),
676
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
677
+ "button",
678
+ {
679
+ onClick: () => setCurrentPage(totalPages),
680
+ disabled: activePage === totalPages,
681
+ 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"}`,
682
+ children: "Last"
683
+ }
684
+ )
685
+ ] }) })
686
+ ] });
687
+ }
688
+
689
+ // src/components/workflowMaster/workFlowMasterMain.js
690
+ var import_jsx_runtime6 = require("react/jsx-runtime");
691
+ function WorkflowMasterMain() {
692
+ const [search, setSearch] = (0, import_react5.useState)("");
693
+ const [entriesPerPage, setEntriesPerPage] = (0, import_react5.useState)(10);
694
+ const [isModalOpen, setIsModalOpen] = (0, import_react5.useState)(false);
695
+ const [newWorkflow, setNewWorkflow] = (0, import_react5.useState)({
696
+ name: "",
697
+ workflowcode: "",
698
+ workflowtype: "",
699
+ version: "1",
700
+ published: "No",
701
+ description: ""
702
+ });
703
+ const [workflows, setWorkflows] = (0, import_react5.useState)([
704
+ {
705
+ id: 1,
706
+ name: "Trade License Workflow",
707
+ workflowcode: "TRD-001",
708
+ workflowtype: "Trade License",
709
+ version: "1",
710
+ published: "Yes",
711
+ status: true
712
+ },
713
+ {
714
+ id: 2,
715
+ name: "Citizen Petition Workflow",
716
+ workflowcode: "PET-001",
717
+ workflowtype: "Petition",
718
+ version: "1",
719
+ published: "Yes",
720
+ status: true
721
+ },
722
+ {
723
+ id: 3,
724
+ name: "Leave Application Workflow",
725
+ workflowcode: "LEV-001",
726
+ workflowtype: "Leave",
727
+ version: "1",
728
+ published: "No",
729
+ status: true
730
+ },
731
+ {
732
+ id: 4,
733
+ name: "Grievance Redressal Workflow",
734
+ workflowcode: "GRV-001",
735
+ workflowtype: "Grievance",
736
+ version: "2",
737
+ published: "Yes",
738
+ status: true
739
+ },
740
+ {
741
+ id: 5,
742
+ name: "Document Verification",
743
+ workflowcode: "DOC-001",
744
+ workflowtype: "Verification",
745
+ version: "1",
746
+ published: "Yes",
747
+ status: true
748
+ },
749
+ {
750
+ id: 6,
751
+ name: "Building Permission Workflow",
752
+ workflowcode: "BLD-001",
753
+ workflowtype: "Building Permission",
754
+ version: "1",
755
+ published: "Yes",
756
+ status: true
757
+ },
758
+ {
759
+ id: 7,
760
+ name: "Property Tax Assessment",
761
+ workflowcode: "PTX-001",
762
+ workflowtype: "Property Tax",
763
+ version: 1,
764
+ published: true,
765
+ status: true
766
+ },
767
+ {
768
+ id: 8,
769
+ name: "Water Connection Request",
770
+ workflowcode: "WTR-001",
771
+ workflowtype: "Utility Services",
772
+ version: 1,
773
+ published: true,
774
+ status: true
775
+ },
776
+ {
777
+ id: 9,
778
+ name: "Vendor Registration",
779
+ workflowcode: "VND-001",
780
+ workflowtype: "Procurement",
781
+ version: 2,
782
+ published: true,
783
+ status: false
784
+ },
785
+ {
786
+ id: 10,
787
+ name: "No Objection Certificate",
788
+ workflowcode: "NOC-001",
789
+ workflowtype: "Certification",
790
+ version: 1,
791
+ published: false,
792
+ status: true
793
+ },
794
+ {
795
+ id: 11,
796
+ name: "Birth Certificate Application",
797
+ workflowcode: "BRT-001",
798
+ workflowtype: "Registry",
799
+ version: 1,
800
+ published: true,
801
+ isActive: true
802
+ }
803
+ ]);
804
+ const handleToggle = (id) => {
805
+ setWorkflows((prev) => prev.map((w) => w.id === id ? __spreadProps(__spreadValues({}, w), { status: !w.status }) : w));
536
806
  };
537
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
538
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
539
- "aside",
540
- {
541
- className: `
542
- flex h-screen flex-col overflow-hidden
543
- border-r border-[#E5E9F1] bg-white
544
- font-sans text-[#273657]
545
- transition-all duration-300 ease-in-out
546
- ${isOpen ? "w-[245px] min-w-[245px] translate-x-0 opacity-100" : "w-0 min-w-0 -translate-x-full opacity-0"}
547
- `,
548
- children: [
549
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
550
- "header",
807
+ const handleAddWorkflow = (e) => {
808
+ e.preventDefault();
809
+ if (!newWorkflow.name || !newWorkflow.workflowcode || !newWorkflow.workflowtype) {
810
+ alert("Please fill out all fields.");
811
+ return;
812
+ }
813
+ const newId = workflows.length > 0 ? Math.max(...workflows.map((w) => w.id)) + 1 : 1;
814
+ const addedItem = {
815
+ id: newId,
816
+ name: newWorkflow.name,
817
+ workflowcode: newWorkflow.workflowcode,
818
+ workflowtype: newWorkflow.workflowtype,
819
+ version: newWorkflow.version || "1",
820
+ published: newWorkflow.published,
821
+ status: true
822
+ };
823
+ setWorkflows([addedItem, ...workflows]);
824
+ setNewWorkflow({ name: "", workflowcode: "", workflowtype: "", version: "1", published: "No", description: "" });
825
+ setIsModalOpen(false);
826
+ };
827
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "min-h-screen bg-[#f3f4f6] p-6 font-sans relative", children: [
828
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "max-w-full mx-auto space-y-5", children: [
829
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-100 shadow-sm p-6 flex justify-between items-center", children: [
830
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
831
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { className: "text-2xl font-bold text-slate-800", children: "Workflow Master" }),
832
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("nav", { className: "text-xs text-slate-400 mt-1", children: [
833
+ "Dashboard > Types > ",
834
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-blue-600 font-semibold", children: "Workflow" })
835
+ ] })
836
+ ] }),
837
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
838
+ "button",
839
+ {
840
+ onClick: () => setIsModalOpen(true),
841
+ 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",
842
+ children: [
843
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-base font-bold", children: "+" }),
844
+ " Add New Workflow"
845
+ ]
846
+ }
847
+ )
848
+ ] }),
849
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-100 shadow-sm p-6 space-y-5", children: [
850
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center justify-between", children: [
851
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "relative w-80", children: [
852
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3.5 pointer-events-none text-slate-400", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) }),
853
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
854
+ "input",
855
+ {
856
+ type: "text",
857
+ placeholder: "Search workflow name or code...",
858
+ value: search,
859
+ onChange: (e) => setSearch(e.target.value),
860
+ 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"
861
+ }
862
+ )
863
+ ] }),
864
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
865
+ "select",
551
866
  {
552
- className: "\r\n flex h-[84px] items-center justify-between\r\n border-b border-[#EDF0F5]\r\n px-[14px]\r\n ",
867
+ value: entriesPerPage,
868
+ onChange: (e) => setEntriesPerPage(Number(e.target.value)),
869
+ 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]",
553
870
  children: [
554
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-2", children: [
555
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
556
- "svg",
557
- {
558
- width: "36",
559
- height: "42",
560
- viewBox: "0 0 48 56",
561
- fill: "none",
562
- children: [
563
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
564
- "path",
565
- {
566
- d: "M24 2L45 12.5L24 23L3 12.5L24 2Z",
567
- fill: "#356AF3"
568
- }
569
- ),
570
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
571
- "path",
572
- {
573
- d: "M24 8L34 13L24 18L14 13L24 8Z",
574
- fill: "white"
575
- }
576
- ),
577
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
578
- "path",
579
- {
580
- d: "M3 20L24 30.5L45 20V27L24 37.5L3 27V20Z",
581
- fill: "#356AF3"
582
- }
583
- ),
584
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
585
- "path",
586
- {
587
- d: "M3 33L24 43.5L45 33V40L24 50.5L3 40V33Z",
588
- fill: "#356AF3"
589
- }
590
- )
591
- ]
592
- }
593
- ),
594
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
595
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { className: "text-[18px] font-extrabold text-[#101318]", children: "FLOWCORE" }),
596
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-[12px] text-[#344261]", children: "Workflow Engine" })
597
- ] })
598
- ] }),
599
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
600
- "button",
601
- {
602
- type: "button",
603
- onClick: onToggle,
604
- 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 ",
605
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react5.RiMenuLine, { size: 18 })
606
- }
607
- )
871
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: 5, children: "5 Rows" }),
872
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: 10, children: "10 Rows" }),
873
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: 20, children: "20 Rows" }),
874
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: 50, children: "50 Rows" })
608
875
  ]
609
876
  }
610
- ),
611
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
612
- "div",
877
+ ) })
878
+ ] }),
879
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
880
+ WorkflowTable,
881
+ {
882
+ search,
883
+ workflows,
884
+ workflowtoggle: handleToggle,
885
+ entriesPerPage,
886
+ setEntriesPerPage
887
+ }
888
+ )
889
+ ] })
890
+ ] }),
891
+ isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "fixed inset-0 bg-slate-900/40 backdrop-blur-sm flex justify-center items-center z-50 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("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: [
892
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "px-8 py-5 border-b border-slate-100 flex justify-between items-center", children: [
893
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-4", children: [
894
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("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__ */ (0, import_jsx_runtime6.jsx)("svg", { className: "w-6 h-6 text-[#5c59eb]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("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" }) }) }),
895
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
896
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add Workflow" }),
897
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-[11px] text-slate-400 font-medium tracking-wide", children: "Create a new workflow and configure its details" })
898
+ ] })
899
+ ] }),
900
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
901
+ "button",
902
+ {
903
+ onClick: () => setIsModalOpen(false),
904
+ className: "text-slate-300 hover:text-slate-500 transition cursor-pointer",
905
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" }) })
906
+ }
907
+ )
908
+ ] }),
909
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("form", { onSubmit: handleAddWorkflow, className: "flex-1 overflow-y-auto p-8 space-y-6", children: [
910
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "border border-slate-100 rounded-2xl p-6 bg-white space-y-5", children: [
911
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2 pb-1 border-b border-slate-50", children: [
912
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-sm", children: "\u{1F4CB}" }),
913
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { className: "text-xs font-bold text-[#5c59eb] uppercase tracking-wider", children: "Workflow Information" })
914
+ ] }),
915
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
916
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
917
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
918
+ "Workflow Type ",
919
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-rose-500", children: "*" })
920
+ ] }),
921
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
922
+ "select",
923
+ {
924
+ required: true,
925
+ value: newWorkflow.workflowtype,
926
+ onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { workflowtype: e.target.value })),
927
+ 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",
928
+ children: [
929
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: "Select workflow type" }),
930
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "Trade License", children: "Trade License" }),
931
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "Petition", children: "Petition" }),
932
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "Leave", children: "Leave" }),
933
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "Grievance", children: "Grievance" }),
934
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "Verification", children: "Verification" })
935
+ ]
936
+ }
937
+ ),
938
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Choose the category this workflow belongs to" })
939
+ ] }),
940
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
941
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
942
+ "Workflow Code ",
943
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-rose-500", children: "*" })
944
+ ] }),
945
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
946
+ "input",
947
+ {
948
+ type: "text",
949
+ required: true,
950
+ placeholder: "Enter workflow code",
951
+ value: newWorkflow.workflowcode,
952
+ onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { workflowcode: e.target.value })),
953
+ 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"
954
+ }
955
+ ),
956
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Unique code for this workflow (e.g., PET-001)" })
957
+ ] })
958
+ ] }),
959
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
960
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
961
+ "Workflow Name ",
962
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-rose-500", children: "*" })
963
+ ] }),
964
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
965
+ "input",
966
+ {
967
+ type: "text",
968
+ required: true,
969
+ placeholder: "Enter workflow name",
970
+ value: newWorkflow.name,
971
+ onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { name: e.target.value })),
972
+ 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"
973
+ }
974
+ ),
975
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Enter a descriptive name for this workflow" })
976
+ ] }),
977
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
978
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
979
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
980
+ "Version ",
981
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-rose-500", children: "*" })
982
+ ] }),
983
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
984
+ "input",
985
+ {
986
+ type: "number",
987
+ required: true,
988
+ placeholder: "1",
989
+ value: newWorkflow.version,
990
+ onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { version: e.target.value })),
991
+ 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"
992
+ }
993
+ ),
994
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Workflow version number" })
995
+ ] }),
996
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
997
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
998
+ "Published ",
999
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-rose-500", children: "*" })
1000
+ ] }),
1001
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1002
+ "select",
1003
+ {
1004
+ required: true,
1005
+ value: newWorkflow.published,
1006
+ onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { published: e.target.value })),
1007
+ 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",
1008
+ children: [
1009
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "No", children: "No" }),
1010
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "Yes", children: "Yes" })
1011
+ ]
1012
+ }
1013
+ ),
1014
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Make workflow active for use" })
1015
+ ] })
1016
+ ] })
1017
+ ] }),
1018
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "border border-slate-100 rounded-2xl p-6 bg-white space-y-3", children: [
1019
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex justify-between items-center", children: [
1020
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { className: "text-xs font-bold text-slate-700", children: "Description" }),
1021
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "text-[10px] text-slate-400", children: [
1022
+ newWorkflow.description.length,
1023
+ " / 500"
1024
+ ] })
1025
+ ] }),
1026
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1027
+ "textarea",
613
1028
  {
614
- 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 ",
615
- children: [
616
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
617
- "p",
1029
+ rows: "3",
1030
+ maxLength: "500",
1031
+ placeholder: "Enter description here...",
1032
+ value: newWorkflow.description,
1033
+ onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { description: e.target.value })),
1034
+ 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"
1035
+ }
1036
+ )
1037
+ ] }),
1038
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex gap-3 justify-end pt-4 border-t border-slate-50", children: [
1039
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1040
+ "button",
1041
+ {
1042
+ type: "button",
1043
+ onClick: () => setIsModalOpen(false),
1044
+ 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",
1045
+ children: [
1046
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u2715" }),
1047
+ " Cancel"
1048
+ ]
1049
+ }
1050
+ ),
1051
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1052
+ "button",
1053
+ {
1054
+ type: "submit",
1055
+ 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",
1056
+ children: [
1057
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u{1F4BE}" }),
1058
+ " Save Workflow"
1059
+ ]
1060
+ }
1061
+ )
1062
+ ] })
1063
+ ] })
1064
+ ] }) })
1065
+ ] });
1066
+ }
1067
+
1068
+ // src/components/WorkflowType/WorkflowTypeMains.js
1069
+ var import_react10 = __toESM(require("react"));
1070
+
1071
+ // src/components/WorkflowType/SearchBar.jsx
1072
+ var import_react6 = __toESM(require("react"));
1073
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1074
+ function SearchBar() {
1075
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative max-w-sm w-full", children: [
1076
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3.5 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { className: "w-4.5 h-4.5 text-slate-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) }),
1077
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1078
+ "input",
1079
+ {
1080
+ type: "text",
1081
+ placeholder: "Search workflow name or code...",
1082
+ 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"
1083
+ }
1084
+ )
1085
+ ] });
1086
+ }
1087
+
1088
+ // src/components/WorkflowType/WorkflowTypeTable.jsx
1089
+ var import_react7 = __toESM(require("react"));
1090
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1091
+ function WorkflowTypeTable({ pageSize }) {
1092
+ const initialData = [
1093
+ { id: "1", name: "Citizen Petition Workflow", code: "PET-001", type: "Petition", version: "1", published: true, status: true },
1094
+ { id: "2", name: "Building Permission Workflow", code: "BLD-001", type: "Building Permission", version: "1", published: true, status: true },
1095
+ { id: "3", name: "Leave Application Workflow", code: "LEV-001", type: "Leave", version: "1", published: false, status: true },
1096
+ { id: "4", name: "Grievance Redressal Workflow", code: "GRV-001", type: "Grievance", version: "2", published: true, status: true },
1097
+ { id: "5", name: "Trade License Workflow", code: "TRD-001", type: "Trade License", version: "1", published: true, status: true },
1098
+ { id: "6", name: "Document Verification", code: "DOC-001", type: "Verification", version: "1", published: true, status: true }
1099
+ ];
1100
+ const [data, setData] = (0, import_react7.useState)(initialData);
1101
+ const [sortOrder, setSortOrder] = (0, import_react7.useState)("asc");
1102
+ const [currentPage, setCurrentPage] = (0, import_react7.useState)(1);
1103
+ const totalPages = Math.ceil(data.length / pageSize) || 1;
1104
+ const startIndex = (currentPage - 1) * pageSize;
1105
+ const visibleData = data.slice(startIndex, startIndex + pageSize);
1106
+ const handleSort = (columnKey) => {
1107
+ const isAsc = sortOrder === "asc";
1108
+ setSortOrder(isAsc ? "desc" : "asc");
1109
+ const sortedData = [...data].sort((a, b) => {
1110
+ if (a[columnKey] < b[columnKey]) return isAsc ? -1 : 1;
1111
+ if (a[columnKey] > b[columnKey]) return isAsc ? 1 : -1;
1112
+ return 0;
1113
+ });
1114
+ setData(sortedData);
1115
+ };
1116
+ const toggleSwitch = (id) => {
1117
+ const updatedData = data.map(
1118
+ (item) => item.id === id ? __spreadProps(__spreadValues({}, item), { status: !item.status }) : item
1119
+ );
1120
+ setData(updatedData);
1121
+ };
1122
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "space-y-5", children: [
1123
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w-full overflow-x-auto border border-slate-200 rounded-2xl shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("table", { className: "w-full text-left border-collapse bg-white", children: [
1124
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("tr", { className: "bg-slate-50/70 border-b border-slate-200 text-xs font-bold uppercase tracking-wider text-slate-500", children: [
1125
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("th", { className: "py-4.5 px-5 w-20 text-center", children: "S.No" }),
1126
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("th", { onClick: () => handleSort("name"), className: "py-4.5 px-5 text-sm cursor-pointer select-none hover:text-slate-900", children: [
1127
+ "Workflow Name ",
1128
+ sortOrder === "asc" ? "\u25B2" : "\u25BC"
1129
+ ] }),
1130
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("th", { onClick: () => handleSort("code"), className: "py-4.5 px-5 cursor-pointer select-none hover:text-slate-900", children: [
1131
+ "Workflow Code ",
1132
+ sortOrder === "asc" ? "\u25B2" : "\u25BC"
1133
+ ] }),
1134
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("th", { onClick: () => handleSort("type"), className: "py-4.5 px-5 cursor-pointer select-none hover:text-slate-900", children: [
1135
+ "Workflow Type ",
1136
+ sortOrder === "asc" ? "\u25B2" : "\u25BC"
1137
+ ] }),
1138
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("th", { className: "py-4.5 px-5 text-center", children: "Version" }),
1139
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("th", { className: "py-4.5 px-5 text-center", children: "Published" }),
1140
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("th", { className: "py-4.5 px-5 text-center", children: "Status" })
1141
+ ] }) }),
1142
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("tbody", { className: "divide-y divide-slate-100 text-sm text-slate-600", children: visibleData.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("tr", { className: "hover:bg-slate-50/50 transition-colors", children: [
1143
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("td", { className: "py-4 px-5 text-center font-medium text-slate-400", children: startIndex + index + 1 }),
1144
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("td", { className: "py-4 px-5 font-bold text-slate-900 text-[14px]", children: item.name }),
1145
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("td", { className: "py-4 px-5 text-slate-500", children: item.code }),
1146
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("td", { className: "py-4 px-5 text-slate-500", children: item.type }),
1147
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("td", { className: "py-4 px-5 text-center font-semibold text-slate-700", children: item.version }),
1148
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("td", { className: "py-4 px-5 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("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" }) }),
1149
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("td", { className: "py-4 px-5 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1150
+ "button",
1151
+ {
1152
+ type: "button",
1153
+ onClick: () => toggleSwitch(item.id),
1154
+ 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"}`,
1155
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1156
+ "span",
1157
+ {
1158
+ 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"}`
1159
+ }
1160
+ )
1161
+ }
1162
+ ) }) })
1163
+ ] }, item.id)) })
1164
+ ] }) }),
1165
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("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: [
1166
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1167
+ "button",
1168
+ {
1169
+ onClick: () => setCurrentPage(1),
1170
+ className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors",
1171
+ children: "First"
1172
+ }
1173
+ ),
1174
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1175
+ "button",
1176
+ {
1177
+ onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)),
1178
+ className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors mr-2",
1179
+ children: "\u2039 Prev"
1180
+ }
1181
+ ),
1182
+ [1, 2, 3, 4].map((pageNumber) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1183
+ "button",
1184
+ {
1185
+ onClick: () => setCurrentPage(pageNumber),
1186
+ 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"}`,
1187
+ children: pageNumber
1188
+ },
1189
+ pageNumber
1190
+ )),
1191
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1192
+ "button",
1193
+ {
1194
+ onClick: () => setCurrentPage((prev) => Math.min(prev + 1, 7)),
1195
+ className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors ml-2",
1196
+ children: "Next \u203A"
1197
+ }
1198
+ ),
1199
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1200
+ "button",
1201
+ {
1202
+ onClick: () => setCurrentPage(7),
1203
+ className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors",
1204
+ children: "Last"
1205
+ }
1206
+ )
1207
+ ] })
1208
+ ] });
1209
+ }
1210
+
1211
+ // src/components/WorkflowType/AddWorkflowTypeModal.jsx
1212
+ var import_react8 = __toESM(require("react"));
1213
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1214
+ function AddWorkflowTypeModal({ isOpen, onClose }) {
1215
+ if (!isOpen) return null;
1216
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1217
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1218
+ "div",
1219
+ {
1220
+ className: "fixed inset-0 bg-slate-900/50 backdrop-blur-sm transition-opacity duration-200",
1221
+ onClick: onClose
1222
+ }
1223
+ ),
1224
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("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: [
1225
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex justify-between items-center px-8 py-6 border-b border-slate-100", children: [
1226
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-4", children: [
1227
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-12 h-12 bg-indigo-50 text-indigo-600 rounded-xl flex items-center justify-center shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("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" }) }) }),
1228
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1229
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add Workflow" }),
1230
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-slate-400 mt-0.5", children: "Create a new workflow and configure its details" })
1231
+ ] })
1232
+ ] }),
1233
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1234
+ "button",
1235
+ {
1236
+ onClick: onClose,
1237
+ className: "text-slate-400 hover:text-slate-600 hover:bg-slate-100 p-2 rounded-full transition-all text-sm font-semibold",
1238
+ children: "\u2715"
1239
+ }
1240
+ )
1241
+ ] }),
1242
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "p-8 space-y-8 overflow-y-auto max-h-[calc(92vh-170px)] bg-slate-50/30", children: [
1243
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1244
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1245
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "\u{1F4CB}" }),
1246
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "Workflow Information" })
1247
+ ] }),
1248
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1249
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1250
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1251
+ "Workflow Type ",
1252
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-red-500", children: "*" })
1253
+ ] }),
1254
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("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: [
1255
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "", children: "Select workflow type" }),
1256
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "petition", children: "Petition" }),
1257
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "building", children: "Building Permission" }),
1258
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "leave", children: "Leave" })
1259
+ ] }),
1260
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Choose the category this workflow belongs to" })
1261
+ ] }),
1262
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1263
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1264
+ "Workflow Code ",
1265
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-red-500", children: "*" })
1266
+ ] }),
1267
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1268
+ "input",
1269
+ {
1270
+ type: "text",
1271
+ placeholder: "Enter workflow code",
1272
+ 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"
1273
+ }
1274
+ ),
1275
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Unique code for this workflow (e.g., PET-001)" })
1276
+ ] })
1277
+ ] }),
1278
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1279
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1280
+ "Workflow Name ",
1281
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-red-500", children: "*" })
1282
+ ] }),
1283
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1284
+ "input",
1285
+ {
1286
+ type: "text",
1287
+ placeholder: "Enter workflow name",
1288
+ 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"
1289
+ }
1290
+ ),
1291
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Enter a descriptive name for this workflow" })
1292
+ ] }),
1293
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1294
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1295
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1296
+ "Version ",
1297
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-red-500", children: "*" })
1298
+ ] }),
1299
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1300
+ "input",
1301
+ {
1302
+ type: "text",
1303
+ defaultValue: "1",
1304
+ 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"
1305
+ }
1306
+ ),
1307
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Workflow version number" })
1308
+ ] }),
1309
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1310
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1311
+ "Published ",
1312
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-red-500", children: "*" })
1313
+ ] }),
1314
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("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: [
1315
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "false", children: "No" }),
1316
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "true", children: "Yes" })
1317
+ ] }),
1318
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Make workflow active for use" })
1319
+ ] })
1320
+ ] })
1321
+ ] }),
1322
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-3", children: [
1323
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex justify-between items-center", children: [
1324
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "block text-xs font-bold text-slate-700", children: "Description" }),
1325
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-[10px] text-slate-400", children: "0 / 500" })
1326
+ ] }),
1327
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1328
+ "textarea",
1329
+ {
1330
+ rows: 3,
1331
+ placeholder: "Enter workflow description (optional)",
1332
+ 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"
1333
+ }
1334
+ ),
1335
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-[10px] text-slate-400", children: "Provide additional information about this workflow" })
1336
+ ] }),
1337
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1338
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1339
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "\u2699\uFE0F" }),
1340
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "Status & Settings" })
1341
+ ] }),
1342
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1343
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1344
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1345
+ "Status ",
1346
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-red-500", children: "*" })
1347
+ ] }),
1348
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("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: [
1349
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "active", children: "Active" }),
1350
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "inactive", children: "Inactive" })
1351
+ ] }),
1352
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Set the initial status of this workflow" })
1353
+ ] }),
1354
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1355
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: "Default Priority" }),
1356
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("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: [
1357
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "medium", children: "Medium" }),
1358
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "high", children: "High" }),
1359
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "low", children: "Low" })
1360
+ ] }),
1361
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Default priority for tasks in this workflow" })
1362
+ ] })
1363
+ ] })
1364
+ ] }),
1365
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1366
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1367
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "\u{1F6E0}\uFE0F" }),
1368
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "Additional Settings" })
1369
+ ] }),
1370
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
1371
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1372
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3", children: [
1373
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u23F1\uFE0F" }),
1374
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1375
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs font-bold text-slate-700", children: "Enable SLA" }),
1376
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-[9px] text-slate-400", children: "Enable SLA for workflow" })
1377
+ ] })
1378
+ ] }),
1379
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1380
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1381
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("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" })
1382
+ ] })
1383
+ ] }),
1384
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1385
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3", children: [
1386
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F504}" }),
1387
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1388
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs font-bold text-slate-700", children: "Allow Rework" }),
1389
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-[9px] text-slate-400", children: "Allow files to be sent back" })
1390
+ ] })
1391
+ ] }),
1392
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1393
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1394
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("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" })
1395
+ ] })
1396
+ ] }),
1397
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1398
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3", children: [
1399
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F465}" }),
1400
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
1401
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs font-bold text-slate-700", children: "Allow File Delegation" }),
1402
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-[9px] text-slate-400", children: "Allow users to delegate tasks" })
1403
+ ] })
1404
+ ] }),
1405
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1406
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("input", { type: "checkbox", className: "sr-only peer" }),
1407
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("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" })
1408
+ ] })
1409
+ ] })
1410
+ ] })
1411
+ ] })
1412
+ ] }),
1413
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "p-5 bg-white border-t border-slate-100 flex items-center justify-end gap-3 px-8", children: [
1414
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1415
+ "button",
1416
+ {
1417
+ onClick: onClose,
1418
+ 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",
1419
+ children: "\u2715 Cancel"
1420
+ }
1421
+ ),
1422
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1423
+ "button",
1424
+ {
1425
+ type: "button",
1426
+ 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",
1427
+ children: "\u{1F4BE} Save Workflow"
1428
+ }
1429
+ )
1430
+ ] })
1431
+ ] })
1432
+ ] });
1433
+ }
1434
+
1435
+ // src/components/WorkflowType/AddButton.jsx
1436
+ var import_react9 = __toESM(require("react"));
1437
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1438
+ function AddButton({ onOpen }) {
1439
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1440
+ "button",
1441
+ {
1442
+ onClick: onOpen,
1443
+ 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",
1444
+ children: [
1445
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("svg", { className: "w-4 h-4 stroke-[2.5]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) }),
1446
+ "Add Workflow Type"
1447
+ ]
1448
+ }
1449
+ );
1450
+ }
1451
+
1452
+ // src/components/WorkflowType/WorkflowTypeMains.js
1453
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1454
+ function WorkflowTypeMains() {
1455
+ const [modalOpen, setModalOpen] = (0, import_react10.useState)(false);
1456
+ const [pageSize, setPageSize] = (0, import_react10.useState)(10);
1457
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "min-h-screen bg-slate-50 p-4 md:p-6", children: [
1458
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w-full space-y-5", children: [
1459
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("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: [
1460
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
1461
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h1", { className: "text-2xl font-extrabold text-slate-900 tracking-tight", children: "Workflow Type" }),
1462
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "text-xs text-slate-400 mt-1", children: [
1463
+ "Dashboard > Types > ",
1464
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-blue-600 font-semibold", children: "Workflow Type" })
1465
+ ] })
1466
+ ] }),
1467
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AddButton, { onOpen: () => setModalOpen(true) })
1468
+ ] }),
1469
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "bg-white p-6 rounded-2xl border border-slate-200/80 shadow-sm space-y-5", children: [
1470
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex justify-between items-center w-full", children: [
1471
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w-full max-w-xs", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SearchBar, {}) }),
1472
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1473
+ "select",
1474
+ {
1475
+ value: pageSize,
1476
+ onChange: (e) => setPageSize(Number(e.target.value)),
1477
+ className: "border border-slate-200 rounded-lg px-3 py-2 text-sm bg-white cursor-pointer outline-none shadow-sm text-slate-700",
1478
+ children: [
1479
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: 2, children: "2 Rows (Testing)" }),
1480
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: 10, children: "10 Rows" }),
1481
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: 20, children: "20 Rows" }),
1482
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: 50, children: "50 Rows" })
1483
+ ]
1484
+ }
1485
+ ) })
1486
+ ] }),
1487
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkflowTypeTable, { pageSize })
1488
+ ] })
1489
+ ] }),
1490
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1491
+ AddWorkflowTypeModal,
1492
+ {
1493
+ isOpen: modalOpen,
1494
+ onClose: () => setModalOpen(false)
1495
+ }
1496
+ )
1497
+ ] });
1498
+ }
1499
+
1500
+ // src/components/WorkFlowTransition/Transitiontable.js
1501
+ var import_react13 = __toESM(require("react"));
1502
+ var import_link3 = __toESM(require("next/link"));
1503
+
1504
+ // src/components/WorkFlowTransition/AddWorkFlowTransitionModal.js
1505
+ var import_react11 = __toESM(require("react"));
1506
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1507
+ function AddWorkTransitionStepModal({ onClose }) {
1508
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1509
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1510
+ "div",
1511
+ {
1512
+ className: "fixed inset-0 bg-slate-900/50 backdrop-blur-sm transition-opacity duration-200",
1513
+ onClick: onClose
1514
+ }
1515
+ ),
1516
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("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: [
1517
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-between items-center px-8 py-6 border-b border-slate-100", children: [
1518
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-4", children: [
1519
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-12 h-12 bg-indigo-50 text-indigo-600 rounded-xl flex items-center justify-center shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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" }) }) }),
1520
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1521
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add Workflow" }),
1522
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs text-slate-400 mt-0.5", children: "Create a new workflow and configure its details" })
1523
+ ] })
1524
+ ] }),
1525
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1526
+ "button",
1527
+ {
1528
+ onClick: onClose,
1529
+ className: "text-slate-400 hover:text-slate-600 hover:bg-slate-100 p-2 rounded-full transition-all text-sm font-semibold",
1530
+ children: "\u2715"
1531
+ }
1532
+ )
1533
+ ] }),
1534
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "p-8 space-y-8 overflow-y-auto max-h-[calc(92vh-170px)] bg-slate-50/30", children: [
1535
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1536
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1537
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u{1F4CB}" }),
1538
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "Workflow Information" })
1539
+ ] }),
1540
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1541
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1542
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1543
+ "Workflow Transition",
1544
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-red-500", children: "*" })
1545
+ ] }),
1546
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("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: [
1547
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "Select workflow type" }),
1548
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "petition", children: "Petition" }),
1549
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "building", children: "Building Permission" }),
1550
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "leave", children: "Leave" })
1551
+ ] }),
1552
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Choose the category this workflow belongs to" })
1553
+ ] }),
1554
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1555
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1556
+ "Workflow Code ",
1557
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-red-500", children: "*" })
1558
+ ] }),
1559
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1560
+ "input",
1561
+ {
1562
+ type: "text",
1563
+ placeholder: "Enter workflow code",
1564
+ 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"
1565
+ }
1566
+ ),
1567
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Unique code for this workflow (e.g., PET-001)" })
1568
+ ] })
1569
+ ] }),
1570
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1571
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1572
+ "Workflow Name ",
1573
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-red-500", children: "*" })
1574
+ ] }),
1575
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1576
+ "input",
1577
+ {
1578
+ type: "text",
1579
+ placeholder: "Enter workflow name",
1580
+ 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"
1581
+ }
1582
+ ),
1583
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Enter a descriptive name for this workflow" })
1584
+ ] }),
1585
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1586
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1587
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1588
+ "Version ",
1589
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-red-500", children: "*" })
1590
+ ] }),
1591
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1592
+ "input",
1593
+ {
1594
+ type: "text",
1595
+ defaultValue: "1",
1596
+ 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"
1597
+ }
1598
+ ),
1599
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Workflow version number" })
1600
+ ] }),
1601
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1602
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1603
+ "Published ",
1604
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-red-500", children: "*" })
1605
+ ] }),
1606
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("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: [
1607
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "false", children: "No" }),
1608
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "true", children: "Yes" })
1609
+ ] }),
1610
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Make workflow active for use" })
1611
+ ] })
1612
+ ] })
1613
+ ] }),
1614
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-3", children: [
1615
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-between items-center", children: [
1616
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { className: "block text-xs font-bold text-slate-700", children: "Description" }),
1617
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-[10px] text-slate-400", children: "0 / 500" })
1618
+ ] }),
1619
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1620
+ "textarea",
1621
+ {
1622
+ rows: 3,
1623
+ placeholder: "Enter workflow description (optional)",
1624
+ 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"
1625
+ }
1626
+ ),
1627
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-[10px] text-slate-400", children: "Provide additional information about this workflow" })
1628
+ ] }),
1629
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1630
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1631
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u2699\uFE0F" }),
1632
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "Status & Settings" })
1633
+ ] }),
1634
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1635
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1636
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1637
+ "Status ",
1638
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-red-500", children: "*" })
1639
+ ] }),
1640
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("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: [
1641
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "active", children: "Active" }),
1642
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "inactive", children: "Inactive" })
1643
+ ] }),
1644
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Set the initial status of this workflow" })
1645
+ ] }),
1646
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1647
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: "Default Priority" }),
1648
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("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: [
1649
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "medium", children: "Medium" }),
1650
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "high", children: "High" }),
1651
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "low", children: "Low" })
1652
+ ] }),
1653
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-[10px] text-slate-400 mt-1", children: "Default priority for tasks in this workflow" })
1654
+ ] })
1655
+ ] })
1656
+ ] }),
1657
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1658
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1659
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u{1F6E0}\uFE0F" }),
1660
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "Additional Settings" })
1661
+ ] }),
1662
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
1663
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1664
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-3", children: [
1665
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u23F1\uFE0F" }),
1666
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1667
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs font-bold text-slate-700", children: "Enable SLA" }),
1668
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-[9px] text-slate-400", children: "Enable SLA for workflow" })
1669
+ ] })
1670
+ ] }),
1671
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1672
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1673
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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" })
1674
+ ] })
1675
+ ] }),
1676
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1677
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-3", children: [
1678
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F504}" }),
1679
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1680
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs font-bold text-slate-700", children: "Allow Rework" }),
1681
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-[9px] text-slate-400", children: "Allow files to be sent back" })
1682
+ ] })
1683
+ ] }),
1684
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1685
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1686
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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" })
1687
+ ] })
1688
+ ] }),
1689
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1690
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-3", children: [
1691
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F465}" }),
1692
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
1693
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs font-bold text-slate-700", children: "Allow File Delegation" }),
1694
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-[9px] text-slate-400", children: "Allow users to delegate tasks" })
1695
+ ] })
1696
+ ] }),
1697
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1698
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { type: "checkbox", className: "sr-only peer" }),
1699
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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" })
1700
+ ] })
1701
+ ] })
1702
+ ] })
1703
+ ] })
1704
+ ] }),
1705
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "p-5 bg-white border-t border-slate-100 flex items-center justify-end gap-3 px-8", children: [
1706
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1707
+ "button",
1708
+ {
1709
+ onClick: onClose,
1710
+ 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",
1711
+ children: "\u2715 Cancel"
1712
+ }
1713
+ ),
1714
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1715
+ "button",
1716
+ {
1717
+ type: "button",
1718
+ 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",
1719
+ children: "\u{1F4BE} Save Workflow"
1720
+ }
1721
+ )
1722
+ ] })
1723
+ ] })
1724
+ ] });
1725
+ }
1726
+
1727
+ // src/components/WorkFlowTransition/Transitionheader.js
1728
+ var import_react12 = __toESM(require("react"));
1729
+ var import_link2 = __toESM(require("next/link"));
1730
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1731
+ function Header() {
1732
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "px-6 py-5 border-b border-gray-200", children: [
1733
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h1", { className: "m-0 text-[30px] leading-tight font-semibold text-[#1E293B] tracking-tight", children: "Workflow" }),
1734
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "mt-2 text-[13px] font-medium", children: [
1735
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("a", { href: "/dashboard", className: "text-blue-600 hover:underline", children: "Dashboard" }),
1736
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "mx-2 text-slate-400", children: ">" }),
1737
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("a", { href: "/masters", className: "text-blue-600 hover:underline", children: "Masters" }),
1738
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "mx-2 text-slate-400", children: ">" }),
1739
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("a", { href: "/workflowTransition", className: "text-blue-600 hover:underline", children: "Workflow Transition" }),
1740
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "mx-2 text-slate-400", children: ">" }),
1741
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-slate-500", children: "Workflow Step" })
1742
+ ] })
1743
+ ] });
1744
+ }
1745
+
1746
+ // src/components/WorkFlowTransition/Transitiontable.js
1747
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1748
+ var WorkflowTransition = [
1749
+ {
1750
+ TransitionId: 1,
1751
+ workflowId: 1,
1752
+ FromStepId: 2,
1753
+ ToStepId: 1,
1754
+ ActionCode: "APPROVE",
1755
+ ActionName: "APPROVE"
1756
+ },
1757
+ {
1758
+ TransitionId: 1,
1759
+ workflowId: 1,
1760
+ FromStepId: 2,
1761
+ ToStepId: 1,
1762
+ ActionCode: "APPROVE",
1763
+ ActionName: "APPROVE"
1764
+ },
1765
+ {
1766
+ TransitionId: 1,
1767
+ workflowId: 1,
1768
+ FromStepId: 2,
1769
+ ToStepId: 1,
1770
+ ActionCode: "APPROVE",
1771
+ ActionName: "APPROVE"
1772
+ },
1773
+ {
1774
+ TransitionId: 1,
1775
+ workflowId: 1,
1776
+ FromStepId: 2,
1777
+ ToStepId: 1,
1778
+ ActionCode: "RETURN",
1779
+ ActionName: "APPROVE"
1780
+ },
1781
+ {
1782
+ TransitionId: 1,
1783
+ workflowId: 1,
1784
+ FromStepId: 2,
1785
+ ToStepId: 1,
1786
+ ActionCode: "APPROVE",
1787
+ ActionName: "RETURN"
1788
+ }
1789
+ ];
1790
+ function WorkFlowTransition() {
1791
+ const [showModal, setShowModal] = (0, import_react13.useState)(false);
1792
+ const [pageSize, setPageSize] = (0, import_react13.useState)(5);
1793
+ const [sortConfig, setSortConfig] = (0, import_react13.useState)({
1794
+ key: "",
1795
+ direction: "asc"
1796
+ });
1797
+ const handleSort = (key) => {
1798
+ let direction = "asc";
1799
+ if (sortConfig.key === key && sortConfig.direction === "asc") {
1800
+ direction = "desc";
1801
+ }
1802
+ setSortConfig({
1803
+ key,
1804
+ direction
1805
+ });
1806
+ };
1807
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "p-6 bg-[#f5f7fb] min-h-screen font-sans text-slate-700", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "bg-white rounded-2xl shadow-md overflow-hidden", children: [
1808
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Header, {}),
1809
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "px-6 py-5 border-b border-gray-200 ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex justify-between items-center flex-wrap gap-3", children: [
1810
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1811
+ "input",
1812
+ {
1813
+ type: "text",
1814
+ placeholder: "Search workflow Transition...",
1815
+ 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"
1816
+ }
1817
+ ),
1818
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: [
1819
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Show" }),
1820
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1821
+ "select",
1822
+ {
1823
+ value: pageSize,
1824
+ onChange: (e) => setPageSize(Number(e.target.value)),
1825
+ className: "inline-flex item-center px-3 py-1 rounded-md bg-[#f1f5f9] text-[#334155] text-xs font-semibold border border-[#e2e8f0]",
1826
+ children: [
1827
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 5, children: "5" }),
1828
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 10, children: "10" }),
1829
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 25, children: "25" })
1830
+ ]
1831
+ }
1832
+ ),
1833
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "entries" })
1834
+ ] }),
1835
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1836
+ "button",
1837
+ {
1838
+ onClick: () => setShowModal(true),
1839
+ className: "px-5 py-2.5 bg-blue-600 text-white rounded-lg text-[13px] font-semibold hover:bg-blue-700 transition-colors",
1840
+ children: "+ Add Workflow Transition"
1841
+ }
1842
+ )
1843
+ ] }) }),
1844
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "overflow-x-auto", children: [
1845
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("table", { className: "w-full border-collapse", children: [
1846
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tr", { className: "bg-slate-50/70 border-b border-slate-200 text-xs font-bold uppercase tracking-wider text-slate-500", children: [
1847
+ { label: "TransitionId", key: "TransitionId" },
1848
+ { label: "WorkflowId", key: "workflowId" },
1849
+ { label: "FromStepId", key: "FromStepId" },
1850
+ { label: "ToStepId", key: "ToStepId" },
1851
+ { label: "ActionCode", key: "ActionCode" },
1852
+ { label: "ActionName", key: "ActionName" }
1853
+ ].map((column) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1854
+ "th",
1855
+ {
1856
+ onClick: () => handleSort(column.key),
1857
+ className: "px-6 py-4 text-left border-b border-gray-200 text-[11px] font-bold uppercase tracking-wider text-slate-500",
1858
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-2", children: [
1859
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: column.label }),
1860
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-gray-400 text-xs", children: sortConfig.key === column.key ? sortConfig.direction === "asc" ? "\u25B2" : "\u25BC" : "\u2195" })
1861
+ ] })
1862
+ },
1863
+ column.key
1864
+ )) }) }),
1865
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tbody", { children: WorkflowTransition.slice(0, pageSize).map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1866
+ "tr",
1867
+ {
1868
+ className: "hover:bg-slate-50 transition-colors",
1869
+ children: [
1870
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "px-6 p-4 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.TransitionId }),
1871
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "px-6 py-4 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.workflowId }),
1872
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "px-6 py-4 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.FromStepId }),
1873
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "px-6 py-4 border-b border-slate-200 text-align center text-[13px] text-slate-500 font-bold", children: item.ToStepId }),
1874
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "px-6 py-4 border-b border-slate-200", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1875
+ "span",
1876
+ {
1877
+ className: `inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold
1878
+ ${item.ActionCode === "APPROVE" ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700"}`,
1879
+ children: item.ActionCode
1880
+ }
1881
+ ) }),
1882
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "px-6 py-4 border-b border-slate-200", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1883
+ "span",
1884
+ {
1885
+ className: `inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold
1886
+ ${item.ActionName === "APPROVE" ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700"}`,
1887
+ children: item.ActionName
1888
+ }
1889
+ ) })
1890
+ ]
1891
+ },
1892
+ item.TransitionId
1893
+ )) })
1894
+ ] }),
1895
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "h-5" }),
1896
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Footer, {}),
1897
+ showModal && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AddWorkTransitionStepModal, { onClose: () => setShowModal(false) })
1898
+ ] })
1899
+ ] }) });
1900
+ }
1901
+
1902
+ // src/components/Sidebar.jsx
1903
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1904
+ var workflowItems = [
1905
+ { name: "Workflow Type", component: "workflowType", icon: import_react15.RiGitMergeLine },
1906
+ { name: "Workflow", component: "workflow", icon: import_react15.RiNodeTree },
1907
+ { name: "Workflow Step", component: "workflowStep", icon: import_react15.RiGitBranchLine },
1908
+ { name: "Workflow Transition", component: "workflowTransition", icon: import_react15.RiCornerDownRightLine }
1909
+ ];
1910
+ var permissionItems = [
1911
+ { name: "Task Permission", path: "/WorkflowType", icon: import_react15.RiUserSettingsLine },
1912
+ { name: "Assignment Rule", path: "/WorkflowType", icon: import_react15.RiFileShieldLine }
1913
+ ];
1914
+ var hierarchyItems = [
1915
+ { name: "Hierarchy Node", path: "/WorkflowType", icon: import_react15.RiNodeTree },
1916
+ { name: "User Hierarchy Mapping", path: "/WorkflowType", icon: import_react15.RiUserSharedLine },
1917
+ { name: "Workflow Settings", path: "/WorkflowType", icon: import_react15.RiSettings4Line }
1918
+ ];
1919
+ var documentItems = [
1920
+ { name: "Document Configuration", path: "/WorkflowType", icon: import_react15.RiFileSettingsLine }
1921
+ ];
1922
+ var fileItems = [
1923
+ { name: "File Instance", path: "/WorkflowType", icon: import_react15.RiFileList3Line },
1924
+ { name: "File Pool", path: "/WorkflowType", icon: import_react15.RiDatabase2Line },
1925
+ { name: "Uploaded Document", path: "/WorkflowType", icon: import_react15.RiFileUploadLine }
1926
+ ];
1927
+ var communicationItems = [
1928
+ { name: "Notification", path: "/WorkflowType", icon: import_react15.RiNotification4Line },
1929
+ { name: "Comment", path: "/WorkflowType", icon: import_react15.RiChat3Line }
1930
+ ];
1931
+ var taskItems = [
1932
+ { name: "Task Instance", path: "/WorkflowType", icon: import_react15.RiCheckboxMultipleLine }
1933
+ ];
1934
+ var trackingItems = [
1935
+ { name: "Audit Log", path: "/WorkflowType", icon: import_react15.RiShieldCheckLine },
1936
+ { name: "Movement History", path: "/WorkflowType", icon: import_react15.RiHistoryLine }
1937
+ ];
1938
+ function Sidebar({ isOpen, onToggle, children }) {
1939
+ const router = (0, import_router.useRouter)();
1940
+ const [workflowOpen, setWorkflowOpen] = (0, import_react14.useState)(false);
1941
+ const [permissionOpen, setPermissionOpen] = (0, import_react14.useState)(false);
1942
+ const [hierarchyOpen, setHierarchyOpen] = (0, import_react14.useState)(false);
1943
+ const [documentOpen, setDocumentOpen] = (0, import_react14.useState)(false);
1944
+ const [filesOpen, setFilesOpen] = (0, import_react14.useState)(false);
1945
+ const [tasksOpen, setTasksOpen] = (0, import_react14.useState)(false);
1946
+ const [trackingOpen, setTrackingOpen] = (0, import_react14.useState)(false);
1947
+ const [communicationOpen, setCommunicationOpen] = (0, import_react14.useState)(false);
1948
+ const [activeComponent, setActiveComponent] = (0, import_react14.useState)("workflowType");
1949
+ const renderMenuItemold = (item) => {
1950
+ const Icon = item.icon;
1951
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1952
+ "button",
1953
+ {
1954
+ type: "button",
1955
+ className: `
1956
+ flex h-[56px] w-full items-center gap-[17px]
1957
+ rounded-[9px] px-[17px]
1958
+ text-left transition-colors duration-150
1959
+ ${router.pathname === item.path ? "bg-blue-50 text-blue-600" : "text-[#344261] hover:bg-[#F6F8FC]"}
1960
+ `,
1961
+ onClick: () => router.push(item.path),
1962
+ children: [
1963
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1964
+ "span",
1965
+ {
1966
+ className: "\r\n flex h-[20px] w-[20px] shrink-0\r\n items-center justify-center\r\n rounded-[6px] text-[#405170]\r\n ",
1967
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { size: 17 })
1968
+ }
1969
+ ),
1970
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "whitespace-nowrap text-[14px] font-medium leading-[22px]", children: item.name })
1971
+ ]
1972
+ },
1973
+ item.name
1974
+ );
1975
+ };
1976
+ const renderMenuItem = (item) => {
1977
+ const Icon = item.icon;
1978
+ const handleClick = () => {
1979
+ if (item.component) {
1980
+ setActiveComponent(item.component);
1981
+ } else {
1982
+ setActiveComponent(null);
1983
+ router.push(item.path);
1984
+ }
1985
+ };
1986
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1987
+ "button",
1988
+ {
1989
+ onClick: handleClick,
1990
+ className: `
1991
+ flex h-[56px] w-full items-center gap-[17px]
1992
+ rounded-[9px] px-[17px]
1993
+ ${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]"}
1994
+ `,
1995
+ children: [
1996
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { size: 17 }),
1997
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: item.name })
1998
+ ]
1999
+ },
2000
+ item.name
2001
+ );
2002
+ };
2003
+ const renderContent = () => {
2004
+ switch (activeComponent) {
2005
+ case "workflowType":
2006
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorkflowTypeMains, {});
2007
+ case "workflow":
2008
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorkflowMasterMain, {});
2009
+ case "workflowStep":
2010
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorkflowStep, {});
2011
+ case "workflowTransition":
2012
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorkFlowTransition, {});
2013
+ default:
2014
+ return children;
2015
+ }
2016
+ };
2017
+ const renderDropdown = (title, open, setOpen, items) => {
2018
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "mb-2", children: [
2019
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2020
+ "button",
2021
+ {
2022
+ type: "button",
2023
+ onClick: () => setOpen(!open),
2024
+ 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 ",
2025
+ children: [
2026
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-[16px] font-semibold", children: title }),
2027
+ open ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.RiArrowDownSLine, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.RiArrowRightSLine, { size: 18 })
2028
+ ]
2029
+ }
2030
+ ),
2031
+ open && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "ml-[8px] border-l border-[#E5E9F1] pl-[4px]", children: items.map(renderMenuItem) })
2032
+ ] });
2033
+ };
2034
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
2035
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2036
+ "aside",
2037
+ {
2038
+ className: `
2039
+ flex h-screen flex-col overflow-hidden
2040
+ border-r border-[#E5E9F1] bg-white
2041
+ font-sans text-[#273657]
2042
+ transition-all duration-300 ease-in-out
2043
+ ${isOpen ? "w-[245px] min-w-[245px] translate-x-0 opacity-100" : "w-0 min-w-0 -translate-x-full opacity-0"}
2044
+ `,
2045
+ children: [
2046
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2047
+ "header",
2048
+ {
2049
+ className: "\r\n flex h-[84px] items-center justify-between\r\n border-b border-[#EDF0F5]\r\n px-[14px]\r\n ",
2050
+ children: [
2051
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-2", children: [
2052
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2053
+ "svg",
2054
+ {
2055
+ width: "36",
2056
+ height: "42",
2057
+ viewBox: "0 0 48 56",
2058
+ fill: "none",
2059
+ children: [
2060
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2061
+ "path",
2062
+ {
2063
+ d: "M24 2L45 12.5L24 23L3 12.5L24 2Z",
2064
+ fill: "#356AF3"
2065
+ }
2066
+ ),
2067
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2068
+ "path",
2069
+ {
2070
+ d: "M24 8L34 13L24 18L14 13L24 8Z",
2071
+ fill: "white"
2072
+ }
2073
+ ),
2074
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2075
+ "path",
2076
+ {
2077
+ d: "M3 20L24 30.5L45 20V27L24 37.5L3 27V20Z",
2078
+ fill: "#356AF3"
2079
+ }
2080
+ ),
2081
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2082
+ "path",
2083
+ {
2084
+ d: "M3 33L24 43.5L45 33V40L24 50.5L3 40V33Z",
2085
+ fill: "#356AF3"
2086
+ }
2087
+ )
2088
+ ]
2089
+ }
2090
+ ),
2091
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
2092
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h1", { className: "text-[18px] font-extrabold text-[#101318]", children: "FLOWCORE" }),
2093
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-[12px] text-[#344261]", children: "Workflow Engine" })
2094
+ ] })
2095
+ ] }),
2096
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2097
+ "button",
2098
+ {
2099
+ type: "button",
2100
+ onClick: onToggle,
2101
+ 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 ",
2102
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.RiMenuLine, { size: 18 })
2103
+ }
2104
+ )
2105
+ ]
2106
+ }
2107
+ ),
2108
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2109
+ "div",
2110
+ {
2111
+ 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 ",
2112
+ children: [
2113
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2114
+ "p",
618
2115
  {
619
2116
  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 ",
620
2117
  children: "Configuration Masters"
621
2118
  }
622
2119
  ),
623
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col gap-[3px]", children: [
2120
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col gap-[3px]", children: [
624
2121
  renderDropdown(
625
2122
  "Workflow",
626
2123
  workflowOpen,
@@ -646,14 +2143,14 @@ function Sidebar({ isOpen, onToggle }) {
646
2143
  hierarchyItems
647
2144
  )
648
2145
  ] }),
649
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2146
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
650
2147
  "p",
651
2148
  {
652
2149
  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 ",
653
2150
  children: "Runtime"
654
2151
  }
655
2152
  ),
656
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col gap-[3px]", children: [
2153
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col gap-[3px]", children: [
657
2154
  renderDropdown(
658
2155
  "Files",
659
2156
  filesOpen,
@@ -682,18 +2179,18 @@ function Sidebar({ isOpen, onToggle }) {
682
2179
  ]
683
2180
  }
684
2181
  ),
685
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2182
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
686
2183
  "div",
687
2184
  {
688
2185
  className: "\r\n shrink-0\r\n bg-white\r\n px-[27px]\r\n pb-[34px]\r\n pt-[18px]\r\n ",
689
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2186
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
690
2187
  "button",
691
2188
  {
692
2189
  type: "button",
693
2190
  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 ",
694
2191
  children: [
695
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react5.RiSettings4Line, { size: 20 }),
696
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "Settings" })
2192
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.RiSettings4Line, { size: 20 }),
2193
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Settings" })
697
2194
  ]
698
2195
  }
699
2196
  )
@@ -702,60 +2199,37 @@ function Sidebar({ isOpen, onToggle }) {
702
2199
  ]
703
2200
  }
704
2201
  ),
705
- !isOpen && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2202
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex-1 overflow-auto bg-[#F5F7FB]", children: renderContent() }),
2203
+ !isOpen && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
706
2204
  "button",
707
2205
  {
708
2206
  type: "button",
709
2207
  onClick: onToggle,
710
2208
  "aria-label": "Open sidebar",
711
2209
  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 ",
712
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react5.RiMenuLine, { size: 18 })
2210
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.RiMenuLine, { size: 18 })
713
2211
  }
714
2212
  )
715
2213
  ] });
716
2214
  }
717
2215
 
718
- // src/pages/Sidebar.js
719
- var import_jsx_runtime6 = require("react/jsx-runtime");
720
- function Home() {
721
- const [isOpen, setIsOpen] = (0, import_react6.useState)(true);
722
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2216
+ // src/components/Layout.jsx
2217
+ var import_react16 = require("react");
2218
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2219
+ var Layout = ({ children }) => {
2220
+ const [isOpen, setIsOpen] = (0, import_react16.useState)(true);
2221
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex min-h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
723
2222
  Sidebar,
724
2223
  {
725
2224
  isOpen,
726
- onToggle: () => setIsOpen(!isOpen)
2225
+ onToggle: () => setIsOpen(!isOpen),
2226
+ childrens: children
727
2227
  }
728
2228
  ) });
729
- }
730
-
731
- // src/components/Layout.jsx
732
- var import_react7 = require("react");
733
- var import_jsx_runtime7 = require("react/jsx-runtime");
734
- var Layout = ({ children }) => {
735
- const [isOpen, setIsOpen] = (0, import_react7.useState)(true);
736
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex min-h-screen", children: [
737
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
738
- Sidebar,
739
- {
740
- isOpen,
741
- onToggle: () => setIsOpen(!isOpen)
742
- }
743
- ),
744
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("main", { className: "flex-1 p-6 bg-gray-100", children })
745
- ] });
746
2229
  };
747
2230
  var Layout_default = Layout;
748
-
749
- // src/pages/AdminPanel.js
750
- var import_react8 = __toESM(require("react"));
751
- var import_jsx_runtime8 = require("react/jsx-runtime");
752
- var AdminPanel = () => {
753
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Layout_default, {}) });
754
- };
755
- var AdminPanel_default = AdminPanel;
756
2231
  // Annotate the CommonJS export names for ESM import in node:
757
2232
  0 && (module.exports = {
758
- AdminPanel,
759
2233
  Layout,
760
2234
  Sidebar,
761
2235
  WorkflowPage