flowcore-fn 2.8.9 → 2.9.5

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