amp-workflow-ui 0.1.12 → 0.1.14

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/index.js CHANGED
@@ -321,9 +321,11 @@ function SendBackDialog({
321
321
  autoHideDuration: 3e3,
322
322
  onClose: handleCloseSnackbar,
323
323
  anchorOrigin: { vertical: "top", horizontal: "right" },
324
+ sx: { zIndex: 9999999 },
324
325
  children: /* @__PURE__ */ jsxRuntime.jsx(
325
326
  material.Alert,
326
327
  {
328
+ variant: "filled",
327
329
  onClose: handleCloseSnackbar,
328
330
  severity: snackbar.severity,
329
331
  sx: {
@@ -479,9 +481,11 @@ function ApproveDialog({
479
481
  autoHideDuration: 3e3,
480
482
  onClose: handleCloseSnackbar,
481
483
  anchorOrigin: { vertical: "top", horizontal: "right" },
484
+ sx: { zIndex: 9999999 },
482
485
  children: /* @__PURE__ */ jsxRuntime.jsx(
483
486
  material.Alert,
484
487
  {
488
+ variant: "filled",
485
489
  onClose: handleCloseSnackbar,
486
490
  severity: snackbar.severity,
487
491
  sx: {
@@ -696,9 +700,11 @@ function RejectDialog({
696
700
  autoHideDuration: 3e3,
697
701
  onClose: handleCloseSnackbar,
698
702
  anchorOrigin: { vertical: "top", horizontal: "right" },
703
+ sx: { zIndex: 9999999 },
699
704
  children: /* @__PURE__ */ jsxRuntime.jsx(
700
705
  material.Alert,
701
706
  {
707
+ variant: "filled",
702
708
  onClose: handleCloseSnackbar,
703
709
  severity: snackbar.severity,
704
710
  sx: {
@@ -854,9 +860,11 @@ function OnHoldDialog({
854
860
  autoHideDuration: 3e3,
855
861
  onClose: handleCloseSnackbar,
856
862
  anchorOrigin: { vertical: "top", horizontal: "right" },
863
+ sx: { zIndex: 9999999 },
857
864
  children: /* @__PURE__ */ jsxRuntime.jsx(
858
865
  material.Alert,
859
866
  {
867
+ variant: "filled",
860
868
  onClose: handleCloseSnackbar,
861
869
  severity: snackbar.severity,
862
870
  sx: {
@@ -1417,1019 +1425,1030 @@ function ApprovalWorkflow({
1417
1425
  /* @__PURE__ */ jsxRuntime.jsx(
1418
1426
  system.Box,
1419
1427
  {
1420
- sx: { display: "flex", justifyContent: "center", flexWrap: "nowrap" },
1421
- children: /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { width: "100%", height: "100%" }, children: [
1422
- /* @__PURE__ */ jsxRuntime.jsxs(
1423
- system.Box,
1424
- {
1425
- sx: {
1426
- display: "flex",
1427
- justifyContent: "space-between",
1428
- alignItems: "center"
1429
- },
1430
- children: [
1431
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { mt: 2, mb: 2 }, children: [
1432
- (selectedWorkflowsList == null ? void 0 : selectedWorkflowsList.length) ? /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: "Selected Workflows", children: /* @__PURE__ */ jsxRuntime.jsx(
1433
- StyledChipProps,
1434
- {
1435
- label: "Selected",
1436
- icon: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-eye" }),
1437
- color: (selectedApprovalOtions == null ? void 0 : selectedApprovalOtions.includes("selected")) ? "primary" : "default",
1438
- variant: "filled",
1439
- sx: {
1440
- mr: 4,
1441
- mb: 4,
1442
- "& .MuiChip-icon": { fontSize: "18px !important" }
1443
- },
1444
- onClick: () => handleProfileToggle("selected")
1445
- }
1446
- ) }) : "",
1447
- approvalChipLabel.map(({ label, icon, count }, index) => /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: `${count} ${label}`, children: /* @__PURE__ */ jsxRuntime.jsx(
1448
- StyledChipProps,
1449
- {
1450
- label: `${count} ${label}`,
1451
- icon,
1452
- color: (selectedApprovalOtions == null ? void 0 : selectedApprovalOtions.includes(label)) ? "primary" : "default",
1453
- variant: "filled",
1454
- sx: {
1455
- mr: 4,
1456
- mb: 4,
1457
- "& .MuiChip-icon": { fontSize: "18px !important" }
1458
- },
1459
- onClick: () => handleProfileToggle(label)
1460
- }
1461
- ) }, index))
1462
- ] }),
1463
- /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { flexGrow: 1, maxWidth: 250, ml: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(
1464
- SearchBox_default,
1465
- {
1466
- placeHolderTitle: "Search",
1467
- searchText,
1468
- handleClearSearch,
1469
- handleInputChange: (e) => handleSearchChange(e.target.value)
1470
- }
1471
- ) })
1472
- ]
1473
- }
1474
- ),
1475
- selectedApprovalOtions === "selected" && /* @__PURE__ */ jsxRuntime.jsx(
1476
- system.Box,
1477
- {
1478
- className: "fixedModal",
1479
- sx: {
1480
- overflowY: "auto",
1481
- height: "calc(100vh - 180px)",
1482
- px: 2,
1483
- pb: 3
1484
- },
1485
- children: visibleSelectedRequests.length > 0 ? visibleSelectedRequests == null ? void 0 : visibleSelectedRequests.map((info, index) => {
1486
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
1487
- const currentLevel = info == null ? void 0 : info.levels.find(
1488
- (level_) => level_.id === (info == null ? void 0 : info.current_level)
1489
- );
1490
- const statusList = currentLevel ? currentLevel.status_list : [];
1491
- (statusList || []).reduce(
1492
- (acc, s) => {
1493
- if ((s == null ? void 0 : s.status) != null) acc[s.status] = s;
1494
- return acc;
1428
+ sx: {
1429
+ display: "flex",
1430
+ justifyContent: "center",
1431
+ flexWrap: "nowrap",
1432
+ overflow: "hidden !important"
1433
+ },
1434
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1435
+ system.Box,
1436
+ {
1437
+ sx: { width: "100%", height: "100%", overflow: "hidden !important" },
1438
+ children: [
1439
+ /* @__PURE__ */ jsxRuntime.jsxs(
1440
+ system.Box,
1441
+ {
1442
+ sx: {
1443
+ display: "flex",
1444
+ justifyContent: "space-between",
1445
+ alignItems: "center"
1495
1446
  },
1496
- {}
1497
- );
1498
- const filterRejectForLevelZero = (statusList2, info2) => {
1499
- if (!(info2 == null ? void 0 : info2.isLevelZero)) return statusList2;
1500
- return statusList2.filter((item) => item.status !== 3);
1501
- };
1502
- const redir = buildRedirectionUrl(info);
1503
- const currentStatus = ((_c2 = (_b2 = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
1504
- (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1505
- )) == null ? void 0 : _b2.selected_status) == null ? void 0 : _c2.status_id) === 1 ? "approved" : ((_f2 = (_e2 = (_d2 = info == null ? void 0 : info.levels) == null ? void 0 : _d2.find(
1506
- (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1507
- )) == null ? void 0 : _e2.selected_status) == null ? void 0 : _f2.status_id) === 3 ? "rejected" : "pending";
1508
- const statusData = getStatus(currentStatus);
1509
- return /* @__PURE__ */ jsxRuntime.jsxs(
1510
- material.Card,
1511
- {
1512
- ref: index === visibleSelectedRequests.length - 1 ? lastCardRef : null,
1513
- sx: {
1514
- mb: 3,
1515
- borderRadius: "14px",
1516
- boxShadow: "0px 2px 10px rgba(76, 78, 100, 0.1)",
1517
- px: 3,
1518
- py: 2,
1519
- background: "white !important"
1520
- },
1521
- children: [
1522
- /* @__PURE__ */ jsxRuntime.jsxs(
1523
- material.CardContent,
1447
+ children: [
1448
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { mt: 2, mb: 2 }, children: [
1449
+ (selectedWorkflowsList == null ? void 0 : selectedWorkflowsList.length) ? /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: "Selected Workflows", children: /* @__PURE__ */ jsxRuntime.jsx(
1450
+ StyledChipProps,
1524
1451
  {
1452
+ label: "Selected",
1453
+ icon: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-eye" }),
1454
+ color: (selectedApprovalOtions == null ? void 0 : selectedApprovalOtions.includes("selected")) ? "primary" : "default",
1455
+ variant: "filled",
1525
1456
  sx: {
1526
- display: "flex",
1527
- justifyContent: "space-between",
1528
- alignItems: "center",
1529
- flexWrap: { xs: "wrap", md: "nowrap" },
1530
- gap: 2
1457
+ mr: 4,
1458
+ mb: 4,
1459
+ "& .MuiChip-icon": { fontSize: "18px !important" }
1531
1460
  },
1532
- children: [
1533
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "22%", minWidth: 220 }, children: [
1534
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsxRuntime.jsx(
1535
- material.Typography,
1536
- {
1537
- variant: "h6",
1538
- fontWeight: 600,
1539
- noWrap: true,
1540
- color: "text.primary",
1541
- children: info.activity_name
1542
- }
1543
- ) }),
1544
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsxRuntime.jsx(
1545
- material.Typography,
1546
- {
1547
- variant: "body2",
1548
- color: "text.secondary",
1549
- noWrap: true,
1550
- sx: { mt: 0.5 },
1551
- children: info.description_data
1552
- }
1553
- ) })
1554
- ] }),
1555
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "20%", minWidth: 180 }, children: [
1556
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
1557
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
1558
- "a",
1559
- {
1560
- href: redir,
1561
- target: "_blank",
1562
- rel: "noreferrer",
1563
- style: {
1564
- cursor: "pointer",
1565
- textDecoration: "none"
1566
- },
1567
- children: /* @__PURE__ */ jsxRuntime.jsx(
1461
+ onClick: () => handleProfileToggle("selected")
1462
+ }
1463
+ ) }) : "",
1464
+ approvalChipLabel.map(({ label, icon, count }, index) => /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: `${count} ${label}`, children: /* @__PURE__ */ jsxRuntime.jsx(
1465
+ StyledChipProps,
1466
+ {
1467
+ label: `${count} ${label}`,
1468
+ icon,
1469
+ color: (selectedApprovalOtions == null ? void 0 : selectedApprovalOtions.includes(label)) ? "primary" : "default",
1470
+ variant: "filled",
1471
+ sx: {
1472
+ mr: 4,
1473
+ mb: 4,
1474
+ "& .MuiChip-icon": { fontSize: "18px !important" }
1475
+ },
1476
+ onClick: () => handleProfileToggle(label)
1477
+ }
1478
+ ) }, index))
1479
+ ] }),
1480
+ /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { flexGrow: 1, maxWidth: 250, ml: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(
1481
+ SearchBox_default,
1482
+ {
1483
+ placeHolderTitle: "Search",
1484
+ searchText,
1485
+ handleClearSearch,
1486
+ handleInputChange: (e) => handleSearchChange(e.target.value)
1487
+ }
1488
+ ) })
1489
+ ]
1490
+ }
1491
+ ),
1492
+ selectedApprovalOtions === "selected" && /* @__PURE__ */ jsxRuntime.jsx(
1493
+ system.Box,
1494
+ {
1495
+ className: "fixedModal hide-scrollbar",
1496
+ sx: {
1497
+ overflowY: "auto",
1498
+ height: "calc(100vh - 180px)",
1499
+ px: 2,
1500
+ pb: 3
1501
+ },
1502
+ children: visibleSelectedRequests.length > 0 ? visibleSelectedRequests == null ? void 0 : visibleSelectedRequests.map((info, index) => {
1503
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
1504
+ const currentLevel = info == null ? void 0 : info.levels.find(
1505
+ (level_) => level_.id === (info == null ? void 0 : info.current_level)
1506
+ );
1507
+ const statusList = currentLevel ? currentLevel.status_list : [];
1508
+ (statusList || []).reduce(
1509
+ (acc, s) => {
1510
+ if ((s == null ? void 0 : s.status) != null) acc[s.status] = s;
1511
+ return acc;
1512
+ },
1513
+ {}
1514
+ );
1515
+ const filterRejectForLevelZero = (statusList2, info2) => {
1516
+ if (!(info2 == null ? void 0 : info2.isLevelZero)) return statusList2;
1517
+ return statusList2.filter((item) => item.status !== 3);
1518
+ };
1519
+ const redir = buildRedirectionUrl(info);
1520
+ const currentStatus = ((_c2 = (_b2 = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
1521
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1522
+ )) == null ? void 0 : _b2.selected_status) == null ? void 0 : _c2.status_id) === 1 ? "approved" : ((_f2 = (_e2 = (_d2 = info == null ? void 0 : info.levels) == null ? void 0 : _d2.find(
1523
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1524
+ )) == null ? void 0 : _e2.selected_status) == null ? void 0 : _f2.status_id) === 3 ? "rejected" : "pending";
1525
+ const statusData = getStatus(currentStatus);
1526
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1527
+ material.Card,
1528
+ {
1529
+ ref: index === visibleSelectedRequests.length - 1 ? lastCardRef : null,
1530
+ sx: {
1531
+ mb: 3,
1532
+ borderRadius: "14px",
1533
+ boxShadow: "0px 2px 10px rgba(76, 78, 100, 0.1)",
1534
+ px: 3,
1535
+ py: 2,
1536
+ background: "white !important"
1537
+ },
1538
+ children: [
1539
+ /* @__PURE__ */ jsxRuntime.jsxs(
1540
+ material.CardContent,
1541
+ {
1542
+ sx: {
1543
+ display: "flex",
1544
+ justifyContent: "space-between",
1545
+ alignItems: "center",
1546
+ flexWrap: { xs: "wrap", md: "nowrap" },
1547
+ gap: 2
1548
+ },
1549
+ children: [
1550
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "22%", minWidth: 220 }, children: [
1551
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsxRuntime.jsx(
1568
1552
  material.Typography,
1569
1553
  {
1570
- variant: "subtitle2",
1571
- color: "primary.dark",
1572
- sx: {
1573
- mt: 0.8,
1574
- lineHeight: "15.4px",
1575
- overflow: "hidden",
1576
- textOverflow: "ellipsis",
1577
- whiteSpace: "nowrap"
1578
- },
1579
- children: redir
1580
- }
1581
- )
1582
- }
1583
- ) })
1584
- ] }),
1585
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
1586
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
1587
- /* @__PURE__ */ jsxRuntime.jsx(
1588
- material.Typography,
1589
- {
1590
- variant: "body2",
1591
- noWrap: true,
1592
- sx: {
1593
- mt: 0.8,
1594
- color: ((_g2 = info == null ? void 0 : info.attachment_links) == null ? void 0 : _g2.length) ? "primary.dark" : "text.disabled"
1595
- },
1596
- children: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? `${info.attachment_links.length} file(s)` : "N/A"
1597
- }
1598
- )
1599
- ] }),
1600
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
1601
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
1602
- /* @__PURE__ */ jsxRuntime.jsx(
1603
- material.Typography,
1604
- {
1605
- variant: "body2",
1606
- sx: {
1607
- mt: 0.8,
1608
- fontWeight: 500,
1609
- color: "text.primary"
1610
- },
1611
- children: (currentLevel == null ? void 0 : currentLevel.tat_expiry) ? moment__default.default(currentLevel.tat_expiry).utcOffset("UTC+05:30").format("DD/MM/YYYY hh:mm A") : "N/A"
1612
- }
1613
- )
1614
- ] }),
1615
- /* @__PURE__ */ jsxRuntime.jsxs(
1616
- system.Box,
1617
- {
1618
- sx: {
1619
- flexBasis: "8%",
1620
- minWidth: 80,
1621
- textAlign: "center"
1622
- },
1623
- children: [
1624
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
1625
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_j = (_i = info == null ? void 0 : info.levels) == null ? void 0 : _i.findIndex(
1626
- (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1627
- )) != null ? _j : -1) + 1 || "") })
1628
- ]
1629
- }
1630
- ),
1631
- /* @__PURE__ */ jsxRuntime.jsxs(
1632
- system.Box,
1633
- {
1634
- sx: {
1635
- flexBasis: "18%",
1636
- minWidth: 200,
1637
- display: "flex",
1638
- alignItems: "center",
1639
- justifyContent: "flex-end",
1640
- gap: 1.5
1641
- },
1642
- children: [
1643
- (info == null ? void 0 : info.current_status) !== "completed" && ((_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find(
1644
- (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1645
- )) == null ? void 0 : _l.order) <= ((_n = (_m = info == null ? void 0 : info.levels) == null ? void 0 : _m.find(
1646
- (lvl) => {
1647
- var _a3;
1648
- return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
1554
+ variant: "h6",
1555
+ fontWeight: 600,
1556
+ noWrap: true,
1557
+ color: "text.primary",
1558
+ children: info.activity_name
1649
1559
  }
1650
- )) == null ? void 0 : _n.order) ? /* @__PURE__ */ jsxRuntime.jsx(
1651
- Statusselector_default,
1560
+ ) }),
1561
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsxRuntime.jsx(
1562
+ material.Typography,
1652
1563
  {
1653
- onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
1654
- onApprove: () => {
1655
- var _a3;
1656
- return handleApprove(
1657
- `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
1658
- );
1659
- },
1660
- onReject: () => {
1661
- var _a3;
1662
- return handleReject(
1663
- `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
1664
- );
1665
- },
1666
- onHold: () => {
1667
- var _a3;
1668
- return handleOnHold(
1669
- `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
1670
- );
1671
- },
1672
- level: info == null ? void 0 : info.isLevelZero,
1673
- statusList: filterRejectForLevelZero(
1674
- statusList,
1675
- info
1676
- )
1564
+ variant: "body2",
1565
+ color: "text.secondary",
1566
+ noWrap: true,
1567
+ sx: { mt: 0.5 },
1568
+ children: info.description_data
1677
1569
  }
1678
- ) : /* @__PURE__ */ jsxRuntime.jsx(
1679
- material.Chip,
1570
+ ) })
1571
+ ] }),
1572
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "20%", minWidth: 180 }, children: [
1573
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
1574
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
1575
+ "a",
1680
1576
  {
1681
- variant: "filled",
1682
- sx: {
1683
- backgroundColor: `${getStatus(currentStatus).color} !important`,
1684
- color: `${getStatus(currentStatus).labelColor} !important`,
1685
- height: "40px",
1686
- px: 2,
1687
- borderRadius: "100px !important",
1688
- "& .MuiChip-label": {
1689
- fontSize: "14px",
1690
- lineHeight: "15.4px",
1691
- fontWeight: "500",
1692
- textTransform: "capitalize"
1693
- }
1577
+ href: redir,
1578
+ target: "_blank",
1579
+ rel: "noreferrer",
1580
+ style: {
1581
+ cursor: "pointer",
1582
+ textDecoration: "none"
1694
1583
  },
1695
- label: statusData.title
1584
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1585
+ material.Typography,
1586
+ {
1587
+ variant: "subtitle2",
1588
+ color: "primary.dark",
1589
+ sx: {
1590
+ mt: 0.8,
1591
+ lineHeight: "15.4px",
1592
+ overflow: "hidden",
1593
+ textOverflow: "ellipsis",
1594
+ whiteSpace: "nowrap"
1595
+ },
1596
+ children: redir
1597
+ }
1598
+ )
1696
1599
  }
1697
- ),
1600
+ ) })
1601
+ ] }),
1602
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
1603
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
1698
1604
  /* @__PURE__ */ jsxRuntime.jsx(
1699
- material.Divider,
1605
+ material.Typography,
1700
1606
  {
1701
- orientation: "vertical",
1702
- flexItem: true,
1607
+ variant: "body2",
1608
+ noWrap: true,
1703
1609
  sx: {
1704
- borderColor: "#E0E0E0",
1705
- height: "40px"
1706
- }
1610
+ mt: 0.8,
1611
+ color: ((_g2 = info == null ? void 0 : info.attachment_links) == null ? void 0 : _g2.length) ? "primary.dark" : "text.disabled"
1612
+ },
1613
+ children: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? `${info.attachment_links.length} file(s)` : "N/A"
1707
1614
  }
1708
- ),
1615
+ )
1616
+ ] }),
1617
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
1618
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
1709
1619
  /* @__PURE__ */ jsxRuntime.jsx(
1710
- material.IconButton,
1620
+ material.Typography,
1711
1621
  {
1712
- disableFocusRipple: true,
1713
- disableRipple: true,
1714
- color: "primary",
1622
+ variant: "body2",
1715
1623
  sx: {
1716
- background: "rgba(25,118,210,0.08)",
1717
- boxShadow: "2px 2px 10px 0px #4C4E6426",
1718
- "& span": { color: "primary.dark" }
1624
+ mt: 0.8,
1625
+ fontWeight: 500,
1626
+ color: "text.primary"
1719
1627
  },
1720
- onClick: () => handleExpandClick(info._id),
1721
- children: expandedId === info._id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-right-3" })
1628
+ children: (currentLevel == null ? void 0 : currentLevel.tat_expiry) ? moment__default.default(currentLevel.tat_expiry).utcOffset("UTC+05:30").format("DD/MM/YYYY hh:mm A") : "N/A"
1722
1629
  }
1723
1630
  )
1724
- ]
1725
- }
1726
- )
1727
- ]
1728
- }
1729
- ),
1730
- expandedId === info._id && /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { mt: 2, ml: 2 }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsxRuntime.jsx(
1731
- system.Box,
1732
- {
1733
- sx: {
1734
- height: 150,
1735
- display: "flex",
1736
- justifyContent: "center",
1737
- alignItems: "center"
1738
- },
1739
- children: /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 36, color: "primary" })
1740
- }
1741
- ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1742
- /* @__PURE__ */ jsxRuntime.jsx(
1743
- CustomTimelineWithStatus,
1744
- {
1745
- events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
1746
- var _a3, _b3, _c3, _d3;
1747
- return {
1748
- date: moment__default.default(item == null ? void 0 : item.created_at).format(
1749
- "DD-MM-YYYY"
1750
- ),
1751
- time: moment__default.default(item == null ? void 0 : item.created_at).format(
1752
- "HH:mm"
1631
+ ] }),
1632
+ /* @__PURE__ */ jsxRuntime.jsxs(
1633
+ system.Box,
1634
+ {
1635
+ sx: {
1636
+ flexBasis: "8%",
1637
+ minWidth: 80,
1638
+ textAlign: "center"
1639
+ },
1640
+ children: [
1641
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
1642
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_j = (_i = info == null ? void 0 : info.levels) == null ? void 0 : _i.findIndex(
1643
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1644
+ )) != null ? _j : -1) + 1 || "") })
1645
+ ]
1646
+ }
1753
1647
  ),
1754
- title: (item == null ? void 0 : item.type) === "create" ? `Raised by - ${(_a3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _a3.full_name}` : ((_b3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _b3.full_name) || "N/A",
1755
- subTitle: ((_c3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _c3.comment) || "No Comments",
1756
- attachment: ((_d3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _d3.file) || null,
1757
- count: (item == null ? void 0 : item.current_level) == "L0" ? "L0" : item == null ? void 0 : item.current_level_count,
1758
- cardType: "card",
1759
- status: (item == null ? void 0 : item.type) === "approve" ? StatusObj.approved : (item == null ? void 0 : item.type) === "reject" ? StatusObj.rejected : (item == null ? void 0 : item.type) === "send_back" ? StatusObj.sendback : (item == null ? void 0 : item.type) === "onhold" ? StatusObj.onhold : null
1760
- };
1761
- })
1762
- }
1763
- ),
1764
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1765
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: "bold" }, children: [
1766
- "Currently Assigned to:",
1767
- " "
1768
- ] }) }),
1769
- /* @__PURE__ */ jsxRuntime.jsx(
1770
- material.Tooltip,
1648
+ /* @__PURE__ */ jsxRuntime.jsxs(
1649
+ system.Box,
1650
+ {
1651
+ sx: {
1652
+ flexBasis: "18%",
1653
+ minWidth: 200,
1654
+ display: "flex",
1655
+ alignItems: "center",
1656
+ justifyContent: "flex-end",
1657
+ gap: 1.5
1658
+ },
1659
+ children: [
1660
+ (info == null ? void 0 : info.current_status) !== "completed" && ((_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find(
1661
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1662
+ )) == null ? void 0 : _l.order) <= ((_n = (_m = info == null ? void 0 : info.levels) == null ? void 0 : _m.find(
1663
+ (lvl) => {
1664
+ var _a3;
1665
+ return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
1666
+ }
1667
+ )) == null ? void 0 : _n.order) ? /* @__PURE__ */ jsxRuntime.jsx(
1668
+ Statusselector_default,
1669
+ {
1670
+ onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
1671
+ onApprove: () => {
1672
+ var _a3;
1673
+ return handleApprove(
1674
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
1675
+ );
1676
+ },
1677
+ onReject: () => {
1678
+ var _a3;
1679
+ return handleReject(
1680
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
1681
+ );
1682
+ },
1683
+ onHold: () => {
1684
+ var _a3;
1685
+ return handleOnHold(
1686
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
1687
+ );
1688
+ },
1689
+ level: info == null ? void 0 : info.isLevelZero,
1690
+ statusList: filterRejectForLevelZero(
1691
+ statusList,
1692
+ info
1693
+ )
1694
+ }
1695
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1696
+ material.Chip,
1697
+ {
1698
+ variant: "filled",
1699
+ sx: {
1700
+ backgroundColor: `${getStatus(currentStatus).color} !important`,
1701
+ color: `${getStatus(currentStatus).labelColor} !important`,
1702
+ height: "40px",
1703
+ px: 2,
1704
+ borderRadius: "100px !important",
1705
+ "& .MuiChip-label": {
1706
+ fontSize: "14px",
1707
+ lineHeight: "15.4px",
1708
+ fontWeight: "500",
1709
+ textTransform: "capitalize"
1710
+ }
1711
+ },
1712
+ label: statusData.title
1713
+ }
1714
+ ),
1715
+ /* @__PURE__ */ jsxRuntime.jsx(
1716
+ material.Divider,
1717
+ {
1718
+ orientation: "vertical",
1719
+ flexItem: true,
1720
+ sx: {
1721
+ borderColor: "#E0E0E0",
1722
+ height: "40px"
1723
+ }
1724
+ }
1725
+ ),
1726
+ /* @__PURE__ */ jsxRuntime.jsx(
1727
+ material.IconButton,
1728
+ {
1729
+ disableFocusRipple: true,
1730
+ disableRipple: true,
1731
+ color: "primary",
1732
+ sx: {
1733
+ background: "rgba(25,118,210,0.08)",
1734
+ boxShadow: "2px 2px 10px 0px #4C4E6426",
1735
+ "& span": { color: "primary.dark" }
1736
+ },
1737
+ onClick: () => handleExpandClick(info._id),
1738
+ children: expandedId === info._id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-right-3" })
1739
+ }
1740
+ )
1741
+ ]
1742
+ }
1743
+ )
1744
+ ]
1745
+ }
1746
+ ),
1747
+ expandedId === info._id && /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { mt: 2, ml: 2 }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsxRuntime.jsx(
1748
+ system.Box,
1771
1749
  {
1772
- title: (info == null ? void 0 : info.isLevelZero) ? (_p = (_o = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _o.created_by_user) == null ? void 0 : _p.official_email_id : (_r = (_q = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _q.assigned_user) == null ? void 0 : _r.official_email_id,
1773
- children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", children: (info == null ? void 0 : info.isLevelZero) ? `${expandedDetails == null ? void 0 : expandedDetails[0].created_by_user.full_name} (${((_t = (_s = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _s.created_by_user) == null ? void 0 : _t.group_employee_code) || "N/A"})` : `${(_v = (_u = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _u.assigned_user) == null ? void 0 : _v.full_name} (${((_x = (_w = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _w.assigned_user) == null ? void 0 : _x.group_employee_code) || "N/A"})` })
1750
+ sx: {
1751
+ height: 150,
1752
+ display: "flex",
1753
+ justifyContent: "center",
1754
+ alignItems: "center"
1755
+ },
1756
+ children: /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 36, color: "primary" })
1774
1757
  }
1775
- )
1776
- ] })
1777
- ] }) })
1778
- ]
1779
- },
1780
- index
1781
- );
1782
- }) : /* @__PURE__ */ jsxRuntime.jsx(
1783
- "div",
1784
- {
1785
- style: {
1786
- height: "100%",
1787
- width: "100%",
1788
- color: "gray",
1789
- fontSize: "20px",
1790
- display: "flex",
1791
- justifyContent: "center",
1792
- alignItems: "center"
1793
- },
1794
- children: "NO RECORD FOUND"
1795
- }
1796
- )
1797
- }
1798
- ),
1799
- selectedApprovalOtions === "All Requests" && /* @__PURE__ */ jsxRuntime.jsx(
1800
- system.Box,
1801
- {
1802
- className: "fixedModal",
1803
- sx: {
1804
- overflowY: "auto",
1805
- height: "calc(100vh - 180px)",
1806
- px: 2,
1807
- pb: 3
1808
- },
1809
- children: visibleAllRequests.length > 0 ? visibleAllRequests == null ? void 0 : visibleAllRequests.map((info, index) => {
1810
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
1811
- if (!(info == null ? void 0 : info.isLevelZero)) {
1812
- console.log("\u{1F680} ~ ApprovalWorkflow ~ Zero:", info);
1813
- }
1814
- const currentLevel = info == null ? void 0 : info.levels.find(
1815
- (level_) => level_.id === (info == null ? void 0 : info.current_level)
1816
- );
1817
- const statusList = currentLevel ? currentLevel.status_list : [];
1818
- (statusList || []).reduce(
1819
- (acc, s) => {
1820
- if ((s == null ? void 0 : s.status) != null) acc[s.status] = s;
1821
- return acc;
1822
- },
1823
- {}
1824
- );
1825
- const filterRejectForLevelZero = (statusList2, info2) => {
1826
- if (!(info2 == null ? void 0 : info2.isLevelZero)) return statusList2;
1827
- return statusList2.filter((item) => item.status !== 3);
1828
- };
1829
- const redir = buildRedirectionUrl(info);
1830
- const currentStatus = ((_c2 = (_b2 = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
1831
- (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1832
- )) == null ? void 0 : _b2.selected_status) == null ? void 0 : _c2.status_id) === 1 ? "approved" : ((_f2 = (_e2 = (_d2 = info == null ? void 0 : info.levels) == null ? void 0 : _d2.find(
1833
- (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1834
- )) == null ? void 0 : _e2.selected_status) == null ? void 0 : _f2.status_id) === 3 ? "rejected" : "pending";
1835
- const statusData = getStatus(currentStatus);
1836
- return /* @__PURE__ */ jsxRuntime.jsxs(
1837
- material.Card,
1838
- {
1839
- ref: index === visibleAllRequests.length - 1 ? lastCardRef : null,
1840
- sx: {
1841
- mb: 3,
1842
- borderRadius: "14px",
1843
- boxShadow: "0px 2px 10px rgba(76, 78, 100, 0.1)",
1844
- px: 3,
1845
- py: 2,
1846
- background: "white !important"
1847
- },
1848
- children: [
1849
- /* @__PURE__ */ jsxRuntime.jsxs(
1850
- material.CardContent,
1851
- {
1852
- sx: {
1853
- display: "flex",
1854
- justifyContent: "space-between",
1855
- alignItems: "center",
1856
- flexWrap: { xs: "wrap", md: "nowrap" },
1857
- gap: 2
1858
- },
1859
- children: [
1860
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "20%", minWidth: 220 }, children: [
1861
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsxRuntime.jsx(
1862
- material.Typography,
1863
- {
1864
- variant: "h6",
1865
- fontWeight: 600,
1866
- noWrap: true,
1867
- color: "text.primary",
1868
- children: info.activity_name
1869
- }
1870
- ) }),
1871
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsxRuntime.jsx(
1872
- material.Typography,
1873
- {
1874
- variant: "body2",
1875
- noWrap: true,
1876
- sx: { mt: 0.5, color: "text.secondary" },
1877
- children: info.description_data
1878
- }
1879
- ) })
1880
- ] }),
1881
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "18%", minWidth: 180 }, children: [
1758
+ ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1759
+ /* @__PURE__ */ jsxRuntime.jsx(
1760
+ CustomTimelineWithStatus,
1761
+ {
1762
+ events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
1763
+ var _a3, _b3, _c3, _d3;
1764
+ return {
1765
+ date: moment__default.default(item == null ? void 0 : item.created_at).format(
1766
+ "DD-MM-YYYY"
1767
+ ),
1768
+ time: moment__default.default(item == null ? void 0 : item.created_at).format(
1769
+ "HH:mm"
1770
+ ),
1771
+ title: (item == null ? void 0 : item.type) === "create" ? `Raised by - ${(_a3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _a3.full_name}` : ((_b3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _b3.full_name) || "N/A",
1772
+ subTitle: ((_c3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _c3.comment) || "No Comments",
1773
+ attachment: ((_d3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _d3.file) || null,
1774
+ count: (item == null ? void 0 : item.current_level) == "L0" ? "L0" : item == null ? void 0 : item.current_level_count,
1775
+ cardType: "card",
1776
+ status: (item == null ? void 0 : item.type) === "approve" ? StatusObj.approved : (item == null ? void 0 : item.type) === "reject" ? StatusObj.rejected : (item == null ? void 0 : item.type) === "send_back" ? StatusObj.sendback : (item == null ? void 0 : item.type) === "onhold" ? StatusObj.onhold : null
1777
+ };
1778
+ })
1779
+ }
1780
+ ),
1781
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1782
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: "bold" }, children: [
1783
+ "Currently Assigned to:",
1784
+ " "
1785
+ ] }) }),
1882
1786
  /* @__PURE__ */ jsxRuntime.jsx(
1883
- material.Typography,
1787
+ material.Tooltip,
1884
1788
  {
1885
- variant: "caption",
1886
- color: "text.secondary",
1887
- sx: { display: "block" },
1888
- children: "Links"
1789
+ title: (info == null ? void 0 : info.isLevelZero) ? (_p = (_o = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _o.created_by_user) == null ? void 0 : _p.official_email_id : (_r = (_q = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _q.assigned_user) == null ? void 0 : _r.official_email_id,
1790
+ children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", children: (info == null ? void 0 : info.isLevelZero) ? `${expandedDetails == null ? void 0 : expandedDetails[0].created_by_user.full_name} (${((_t = (_s = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _s.created_by_user) == null ? void 0 : _t.group_employee_code) || "N/A"})` : `${(_v = (_u = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _u.assigned_user) == null ? void 0 : _v.full_name} (${((_x = (_w = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _w.assigned_user) == null ? void 0 : _x.group_employee_code) || "N/A"})` })
1889
1791
  }
1890
- ),
1891
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
1892
- "a",
1893
- {
1894
- href: redir,
1895
- target: "_blank",
1896
- rel: "noreferrer",
1897
- style: {
1898
- cursor: "pointer",
1899
- textDecoration: "none"
1900
- },
1901
- children: /* @__PURE__ */ jsxRuntime.jsx(
1792
+ )
1793
+ ] })
1794
+ ] }) })
1795
+ ]
1796
+ },
1797
+ index
1798
+ );
1799
+ }) : /* @__PURE__ */ jsxRuntime.jsx(
1800
+ "div",
1801
+ {
1802
+ style: {
1803
+ height: "100%",
1804
+ width: "100%",
1805
+ color: "gray",
1806
+ fontSize: "20px",
1807
+ display: "flex",
1808
+ justifyContent: "center",
1809
+ alignItems: "center"
1810
+ },
1811
+ children: "NO RECORD FOUND"
1812
+ }
1813
+ )
1814
+ }
1815
+ ),
1816
+ selectedApprovalOtions === "All Requests" && /* @__PURE__ */ jsxRuntime.jsx(
1817
+ system.Box,
1818
+ {
1819
+ className: "fixedModal hide-scrollbar",
1820
+ sx: {
1821
+ overflowY: "auto",
1822
+ height: "calc(100vh - 180px)",
1823
+ px: 2,
1824
+ pb: 3
1825
+ },
1826
+ children: visibleAllRequests.length > 0 ? visibleAllRequests == null ? void 0 : visibleAllRequests.map((info, index) => {
1827
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
1828
+ if (!(info == null ? void 0 : info.isLevelZero)) {
1829
+ console.log("\u{1F680} ~ ApprovalWorkflow ~ Zero:", info);
1830
+ }
1831
+ const currentLevel = info == null ? void 0 : info.levels.find(
1832
+ (level_) => level_.id === (info == null ? void 0 : info.current_level)
1833
+ );
1834
+ const statusList = currentLevel ? currentLevel.status_list : [];
1835
+ (statusList || []).reduce(
1836
+ (acc, s) => {
1837
+ if ((s == null ? void 0 : s.status) != null) acc[s.status] = s;
1838
+ return acc;
1839
+ },
1840
+ {}
1841
+ );
1842
+ const filterRejectForLevelZero = (statusList2, info2) => {
1843
+ if (!(info2 == null ? void 0 : info2.isLevelZero)) return statusList2;
1844
+ return statusList2.filter((item) => item.status !== 3);
1845
+ };
1846
+ const redir = buildRedirectionUrl(info);
1847
+ const currentStatus = ((_c2 = (_b2 = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
1848
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1849
+ )) == null ? void 0 : _b2.selected_status) == null ? void 0 : _c2.status_id) === 1 ? "approved" : ((_f2 = (_e2 = (_d2 = info == null ? void 0 : info.levels) == null ? void 0 : _d2.find(
1850
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1851
+ )) == null ? void 0 : _e2.selected_status) == null ? void 0 : _f2.status_id) === 3 ? "rejected" : "pending";
1852
+ const statusData = getStatus(currentStatus);
1853
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1854
+ material.Card,
1855
+ {
1856
+ ref: index === visibleAllRequests.length - 1 ? lastCardRef : null,
1857
+ sx: {
1858
+ mb: 3,
1859
+ borderRadius: "14px",
1860
+ boxShadow: "0px 2px 10px rgba(76, 78, 100, 0.1)",
1861
+ px: 3,
1862
+ py: 2,
1863
+ background: "white !important"
1864
+ },
1865
+ children: [
1866
+ /* @__PURE__ */ jsxRuntime.jsxs(
1867
+ material.CardContent,
1868
+ {
1869
+ sx: {
1870
+ display: "flex",
1871
+ justifyContent: "space-between",
1872
+ alignItems: "center",
1873
+ flexWrap: { xs: "wrap", md: "nowrap" },
1874
+ gap: 2
1875
+ },
1876
+ children: [
1877
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "20%", minWidth: 220 }, children: [
1878
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsxRuntime.jsx(
1902
1879
  material.Typography,
1903
1880
  {
1904
- variant: "subtitle2",
1905
- color: "primary.dark",
1906
- sx: {
1907
- mt: 0.8,
1908
- lineHeight: "15.4px",
1909
- overflow: "hidden",
1910
- textOverflow: "ellipsis",
1911
- whiteSpace: "nowrap"
1912
- },
1913
- children: redir
1881
+ variant: "h6",
1882
+ fontWeight: 600,
1883
+ noWrap: true,
1884
+ color: "text.primary",
1885
+ children: info.activity_name
1914
1886
  }
1915
- )
1916
- }
1917
- ) })
1918
- ] }),
1919
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
1920
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
1921
- /* @__PURE__ */ jsxRuntime.jsx(
1922
- material.Typography,
1923
- {
1924
- variant: "body2",
1925
- noWrap: true,
1926
- sx: {
1927
- mt: 0.8,
1928
- color: ((_g2 = info == null ? void 0 : info.attachment_links) == null ? void 0 : _g2.length) ? "primary.dark" : "text.disabled"
1929
- },
1930
- children: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? `${info.attachment_links.length} file(s)` : "N/A"
1931
- }
1932
- )
1933
- ] }),
1934
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
1935
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
1936
- /* @__PURE__ */ jsxRuntime.jsx(
1937
- material.Typography,
1938
- {
1939
- variant: "body2",
1940
- sx: {
1941
- mt: 0.8,
1942
- fontWeight: 500,
1943
- color: "text.primary"
1944
- },
1945
- children: (currentLevel == null ? void 0 : currentLevel.tat_expiry) ? moment__default.default(currentLevel.tat_expiry).utcOffset("UTC+05:30").format("DD/MM/YYYY hh:mm A") : "N/A"
1946
- }
1947
- )
1948
- ] }),
1949
- /* @__PURE__ */ jsxRuntime.jsxs(
1950
- system.Box,
1951
- {
1952
- sx: {
1953
- flexBasis: "8%",
1954
- minWidth: 80,
1955
- textAlign: "center"
1956
- },
1957
- children: [
1958
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
1959
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_j = (_i = info == null ? void 0 : info.levels) == null ? void 0 : _i.findIndex(
1960
- (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1961
- )) != null ? _j : -1) + 1 || "") })
1962
- ]
1963
- }
1964
- ),
1965
- /* @__PURE__ */ jsxRuntime.jsxs(
1966
- system.Box,
1967
- {
1968
- sx: {
1969
- flexBasis: "18%",
1970
- minWidth: 200,
1971
- display: "flex",
1972
- alignItems: "center",
1973
- justifyContent: "flex-end",
1974
- gap: 1.5
1975
- },
1976
- children: [
1977
- (info == null ? void 0 : info.current_status) !== "completed" && ((_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find(
1978
- (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1979
- )) == null ? void 0 : _l.order) <= ((_n = (_m = info == null ? void 0 : info.levels) == null ? void 0 : _m.find(
1980
- (lvl) => {
1981
- var _a3;
1982
- return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
1983
- }
1984
- )) == null ? void 0 : _n.order) ? /* @__PURE__ */ jsxRuntime.jsx(
1985
- Statusselector_default,
1887
+ ) }),
1888
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsxRuntime.jsx(
1889
+ material.Typography,
1986
1890
  {
1987
- onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
1988
- onApprove: () => {
1989
- var _a3;
1990
- return handleApprove(
1991
- `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
1992
- );
1993
- },
1994
- onReject: () => {
1995
- var _a3;
1996
- return handleReject(
1997
- `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
1998
- );
1999
- },
2000
- onHold: () => {
2001
- var _a3;
2002
- return handleOnHold(
2003
- `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
2004
- );
2005
- },
2006
- level: info == null ? void 0 : info.isLevelZero,
2007
- statusList: filterRejectForLevelZero(
2008
- statusList,
2009
- info
2010
- )
1891
+ variant: "body2",
1892
+ noWrap: true,
1893
+ sx: { mt: 0.5, color: "text.secondary" },
1894
+ children: info.description_data
2011
1895
  }
2012
- ) : /* @__PURE__ */ jsxRuntime.jsx(
2013
- material.Chip,
1896
+ ) })
1897
+ ] }),
1898
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "18%", minWidth: 180 }, children: [
1899
+ /* @__PURE__ */ jsxRuntime.jsx(
1900
+ material.Typography,
2014
1901
  {
2015
- variant: "filled",
2016
- sx: {
2017
- backgroundColor: `${getStatus(currentStatus).color} !important`,
2018
- color: `${getStatus(currentStatus).labelColor} !important`,
2019
- height: "40px",
2020
- px: 2,
2021
- borderRadius: "100px !important",
2022
- "& .MuiChip-label": {
2023
- fontSize: "14px",
2024
- lineHeight: "15.4px",
2025
- fontWeight: "500",
2026
- textTransform: "capitalize"
2027
- }
2028
- },
2029
- label: statusData.title
1902
+ variant: "caption",
1903
+ color: "text.secondary",
1904
+ sx: { display: "block" },
1905
+ children: "Links"
2030
1906
  }
2031
1907
  ),
2032
- /* @__PURE__ */ jsxRuntime.jsx(
2033
- material.Divider,
1908
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
1909
+ "a",
2034
1910
  {
2035
- orientation: "vertical",
2036
- flexItem: true,
2037
- sx: {
2038
- borderColor: "#E0E0E0",
2039
- height: "40px"
2040
- }
1911
+ href: redir,
1912
+ target: "_blank",
1913
+ rel: "noreferrer",
1914
+ style: {
1915
+ cursor: "pointer",
1916
+ textDecoration: "none"
1917
+ },
1918
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1919
+ material.Typography,
1920
+ {
1921
+ variant: "subtitle2",
1922
+ color: "primary.dark",
1923
+ sx: {
1924
+ mt: 0.8,
1925
+ lineHeight: "15.4px",
1926
+ overflow: "hidden",
1927
+ textOverflow: "ellipsis",
1928
+ whiteSpace: "nowrap"
1929
+ },
1930
+ children: redir
1931
+ }
1932
+ )
2041
1933
  }
2042
- ),
1934
+ ) })
1935
+ ] }),
1936
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
1937
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
2043
1938
  /* @__PURE__ */ jsxRuntime.jsx(
2044
- material.IconButton,
1939
+ material.Typography,
2045
1940
  {
2046
- disableFocusRipple: true,
2047
- disableRipple: true,
2048
- color: "primary",
1941
+ variant: "body2",
1942
+ noWrap: true,
2049
1943
  sx: {
2050
- background: "rgba(25,118,210,0.08)",
2051
- boxShadow: "2px 2px 10px 0px #4C4E6426",
2052
- "& span": { color: "primary.dark" }
1944
+ mt: 0.8,
1945
+ color: ((_g2 = info == null ? void 0 : info.attachment_links) == null ? void 0 : _g2.length) ? "primary.dark" : "text.disabled"
2053
1946
  },
2054
- onClick: () => handleExpandClick(info._id),
2055
- children: expandedId === info._id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-right-3" })
1947
+ children: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? `${info.attachment_links.length} file(s)` : "N/A"
2056
1948
  }
2057
1949
  )
2058
- ]
2059
- }
2060
- )
2061
- ]
2062
- }
2063
- ),
2064
- expandedId === info._id && /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { mt: 2, ml: 2 }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsxRuntime.jsx(
2065
- system.Box,
2066
- {
2067
- sx: {
2068
- height: 150,
2069
- display: "flex",
2070
- justifyContent: "center",
2071
- alignItems: "center"
2072
- },
2073
- children: /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 36, color: "primary" })
2074
- }
2075
- ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2076
- /* @__PURE__ */ jsxRuntime.jsx(
2077
- CustomTimelineWithStatus,
2078
- {
2079
- events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
2080
- var _a3, _b3, _c3, _d3;
2081
- return {
2082
- date: moment__default.default(item == null ? void 0 : item.created_at).format(
2083
- "DD-MM-YYYY"
2084
- ),
2085
- time: moment__default.default(item == null ? void 0 : item.created_at).format(
2086
- "HH:mm"
2087
- ),
2088
- title: (item == null ? void 0 : item.type) === "create" ? `Raised by - ${(_a3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _a3.full_name}` : ((_b3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _b3.full_name) || "N/A",
2089
- subTitle: ((_c3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _c3.comment) || "No Comments",
2090
- attachment: ((_d3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _d3.file) || null,
2091
- count: (item == null ? void 0 : item.current_level) == "L0" ? "L0" : item == null ? void 0 : item.current_level_count,
2092
- cardType: "card",
2093
- status: (item == null ? void 0 : item.type) === "approve" ? StatusObj.approved : (item == null ? void 0 : item.type) === "reject" ? StatusObj.rejected : (item == null ? void 0 : item.type) === "send_back" ? StatusObj.sendback : (item == null ? void 0 : item.type) === "onhold" ? StatusObj.onhold : null
2094
- };
2095
- })
2096
- }
2097
- ),
2098
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2099
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: "bold" }, children: [
2100
- "Currently Assigned to:",
2101
- " "
2102
- ] }) }),
2103
- /* @__PURE__ */ jsxRuntime.jsx(
2104
- material.Tooltip,
2105
- {
2106
- title: (info == null ? void 0 : info.isLevelZero) ? (_p = (_o = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _o.created_by_user) == null ? void 0 : _p.official_email_id : (_r = (_q = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _q.assigned_user) == null ? void 0 : _r.official_email_id,
2107
- children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", children: (info == null ? void 0 : info.isLevelZero) ? `${expandedDetails == null ? void 0 : expandedDetails[0].created_by_user.full_name} (${((_t = (_s = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _s.created_by_user) == null ? void 0 : _t.group_employee_code) || "N/A"})` : `${(_v = (_u = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _u.assigned_user) == null ? void 0 : _v.full_name} (${((_x = (_w = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _w.assigned_user) == null ? void 0 : _x.group_employee_code) || "N/A"})` })
2108
- }
2109
- )
2110
- ] })
2111
- ] }) })
2112
- ]
2113
- },
2114
- index
2115
- );
2116
- }) : /* @__PURE__ */ jsxRuntime.jsx(
2117
- "div",
2118
- {
2119
- style: {
2120
- height: "100%",
2121
- width: "100%",
2122
- color: "gray",
2123
- fontSize: "20px",
2124
- display: "flex",
2125
- justifyContent: "center",
2126
- alignItems: "center"
2127
- },
2128
- children: "NO RECORD FOUND"
2129
- }
2130
- )
2131
- }
2132
- ),
2133
- selectedApprovalOtions === "Action Required" && /* @__PURE__ */ jsxRuntime.jsx(
2134
- system.Box,
2135
- {
2136
- className: "fixedModal",
2137
- sx: {
2138
- overflowY: "auto",
2139
- height: "calc(100vh - 180px)",
2140
- px: 2,
2141
- pb: 3
2142
- },
2143
- children: visiblePendingRequests.length > 0 ? visiblePendingRequests == null ? void 0 : visiblePendingRequests.map((info, index) => {
2144
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
2145
- const currentLevel = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
2146
- (level_) => level_.id === (info == null ? void 0 : info.current_level)
2147
- );
2148
- const statusList = currentLevel ? currentLevel.status_list : [];
2149
- const filterRejectForLevelZero = (statusList2, info2) => {
2150
- if (!(info2 == null ? void 0 : info2.isLevelZero)) return statusList2;
2151
- return statusList2.filter((item) => item.status !== 3);
2152
- };
2153
- const redir = buildRedirectionUrl(info);
2154
- const currentStatus = ((_d2 = (_c2 = (_b2 = info == null ? void 0 : info.levels) == null ? void 0 : _b2.find(
2155
- (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
2156
- )) == null ? void 0 : _c2.selected_status) == null ? void 0 : _d2.status_id) === 1 ? "approved" : ((_g2 = (_f2 = (_e2 = info == null ? void 0 : info.levels) == null ? void 0 : _e2.find(
2157
- (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
2158
- )) == null ? void 0 : _f2.selected_status) == null ? void 0 : _g2.status_id) === 3 ? "rejected" : "pending";
2159
- const statusData = getStatus(currentStatus);
2160
- return /* @__PURE__ */ jsxRuntime.jsxs(
2161
- material.Card,
2162
- {
2163
- ref: index === visiblePendingRequests.length - 1 ? lastCardRef : null,
2164
- sx: {
2165
- mb: 3,
2166
- borderRadius: "14px",
2167
- boxShadow: "0px 2px 10px rgba(76, 78, 100, 0.1)",
2168
- px: 3,
2169
- py: 2,
2170
- background: "white !important"
2171
- },
2172
- children: [
2173
- /* @__PURE__ */ jsxRuntime.jsxs(
2174
- material.CardContent,
2175
- {
2176
- sx: {
2177
- display: "flex",
2178
- justifyContent: "space-between",
2179
- alignItems: "center",
2180
- flexWrap: { xs: "wrap", md: "nowrap" },
2181
- gap: 2
2182
- },
2183
- children: [
2184
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "20%", minWidth: 220 }, children: [
2185
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "h6", fontWeight: 600, noWrap: true, children: info.activity_name }) }),
2186
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsxRuntime.jsx(
2187
- material.Typography,
2188
- {
2189
- variant: "body2",
2190
- color: "text.secondary",
2191
- noWrap: true,
2192
- sx: { mt: 0.5 },
2193
- children: info.description_data
2194
- }
2195
- ) })
2196
- ] }),
2197
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "18%", minWidth: 180 }, children: [
2198
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
2199
- /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
2200
- "a",
2201
- {
2202
- href: redir,
2203
- target: "_blank",
2204
- rel: "noreferrer",
2205
- style: {
2206
- cursor: "pointer",
2207
- textDecoration: "none"
2208
- },
2209
- children: /* @__PURE__ */ jsxRuntime.jsx(
1950
+ ] }),
1951
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
1952
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
1953
+ /* @__PURE__ */ jsxRuntime.jsx(
2210
1954
  material.Typography,
2211
1955
  {
2212
- variant: "subtitle2",
2213
- color: "primary.dark",
1956
+ variant: "body2",
2214
1957
  sx: {
2215
1958
  mt: 0.8,
2216
- lineHeight: "15.4px",
2217
- overflow: "hidden",
2218
- textOverflow: "ellipsis",
2219
- whiteSpace: "nowrap"
1959
+ fontWeight: 500,
1960
+ color: "text.primary"
2220
1961
  },
2221
- children: redir
1962
+ children: (currentLevel == null ? void 0 : currentLevel.tat_expiry) ? moment__default.default(currentLevel.tat_expiry).utcOffset("UTC+05:30").format("DD/MM/YYYY hh:mm A") : "N/A"
2222
1963
  }
2223
1964
  )
2224
- }
2225
- ) })
2226
- ] }),
2227
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
2228
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
2229
- /* @__PURE__ */ jsxRuntime.jsx(
2230
- material.Typography,
2231
- {
2232
- variant: "body2",
2233
- noWrap: true,
2234
- sx: {
2235
- mt: 0.8,
2236
- color: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? "primary.dark" : "text.disabled"
2237
- },
2238
- children: ((_i = info == null ? void 0 : info.attachment_links) == null ? void 0 : _i.length) ? `${info.attachment_links.length} file(s)` : "N/A"
2239
- }
2240
- )
2241
- ] }),
2242
- /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
2243
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
1965
+ ] }),
1966
+ /* @__PURE__ */ jsxRuntime.jsxs(
1967
+ system.Box,
1968
+ {
1969
+ sx: {
1970
+ flexBasis: "8%",
1971
+ minWidth: 80,
1972
+ textAlign: "center"
1973
+ },
1974
+ children: [
1975
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
1976
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_j = (_i = info == null ? void 0 : info.levels) == null ? void 0 : _i.findIndex(
1977
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1978
+ )) != null ? _j : -1) + 1 || "") })
1979
+ ]
1980
+ }
1981
+ ),
1982
+ /* @__PURE__ */ jsxRuntime.jsxs(
1983
+ system.Box,
1984
+ {
1985
+ sx: {
1986
+ flexBasis: "18%",
1987
+ minWidth: 200,
1988
+ display: "flex",
1989
+ alignItems: "center",
1990
+ justifyContent: "flex-end",
1991
+ gap: 1.5
1992
+ },
1993
+ children: [
1994
+ (info == null ? void 0 : info.current_status) !== "completed" && ((_l = (_k = info == null ? void 0 : info.levels) == null ? void 0 : _k.find(
1995
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
1996
+ )) == null ? void 0 : _l.order) <= ((_n = (_m = info == null ? void 0 : info.levels) == null ? void 0 : _m.find(
1997
+ (lvl) => {
1998
+ var _a3;
1999
+ return Number(lvl.assign_to[0]) === ((_a3 = userInfo == null ? void 0 : userInfo.userInfo) == null ? void 0 : _a3.id);
2000
+ }
2001
+ )) == null ? void 0 : _n.order) ? /* @__PURE__ */ jsxRuntime.jsx(
2002
+ Statusselector_default,
2003
+ {
2004
+ onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
2005
+ onApprove: () => {
2006
+ var _a3;
2007
+ return handleApprove(
2008
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
2009
+ );
2010
+ },
2011
+ onReject: () => {
2012
+ var _a3;
2013
+ return handleReject(
2014
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
2015
+ );
2016
+ },
2017
+ onHold: () => {
2018
+ var _a3;
2019
+ return handleOnHold(
2020
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
2021
+ );
2022
+ },
2023
+ level: info == null ? void 0 : info.isLevelZero,
2024
+ statusList: filterRejectForLevelZero(
2025
+ statusList,
2026
+ info
2027
+ )
2028
+ }
2029
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
2030
+ material.Chip,
2031
+ {
2032
+ variant: "filled",
2033
+ sx: {
2034
+ backgroundColor: `${getStatus(currentStatus).color} !important`,
2035
+ color: `${getStatus(currentStatus).labelColor} !important`,
2036
+ height: "40px",
2037
+ px: 2,
2038
+ borderRadius: "100px !important",
2039
+ "& .MuiChip-label": {
2040
+ fontSize: "14px",
2041
+ lineHeight: "15.4px",
2042
+ fontWeight: "500",
2043
+ textTransform: "capitalize"
2044
+ }
2045
+ },
2046
+ label: statusData.title
2047
+ }
2048
+ ),
2049
+ /* @__PURE__ */ jsxRuntime.jsx(
2050
+ material.Divider,
2051
+ {
2052
+ orientation: "vertical",
2053
+ flexItem: true,
2054
+ sx: {
2055
+ borderColor: "#E0E0E0",
2056
+ height: "40px"
2057
+ }
2058
+ }
2059
+ ),
2060
+ /* @__PURE__ */ jsxRuntime.jsx(
2061
+ material.IconButton,
2062
+ {
2063
+ disableFocusRipple: true,
2064
+ disableRipple: true,
2065
+ color: "primary",
2066
+ sx: {
2067
+ background: "rgba(25,118,210,0.08)",
2068
+ boxShadow: "2px 2px 10px 0px #4C4E6426",
2069
+ "& span": { color: "primary.dark" }
2070
+ },
2071
+ onClick: () => handleExpandClick(info._id),
2072
+ children: expandedId === info._id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-right-3" })
2073
+ }
2074
+ )
2075
+ ]
2076
+ }
2077
+ )
2078
+ ]
2079
+ }
2080
+ ),
2081
+ expandedId === info._id && /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { mt: 2, ml: 2 }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsxRuntime.jsx(
2082
+ system.Box,
2083
+ {
2084
+ sx: {
2085
+ height: 150,
2086
+ display: "flex",
2087
+ justifyContent: "center",
2088
+ alignItems: "center"
2089
+ },
2090
+ children: /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 36, color: "primary" })
2091
+ }
2092
+ ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2093
+ /* @__PURE__ */ jsxRuntime.jsx(
2094
+ CustomTimelineWithStatus,
2095
+ {
2096
+ events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
2097
+ var _a3, _b3, _c3, _d3;
2098
+ return {
2099
+ date: moment__default.default(item == null ? void 0 : item.created_at).format(
2100
+ "DD-MM-YYYY"
2101
+ ),
2102
+ time: moment__default.default(item == null ? void 0 : item.created_at).format(
2103
+ "HH:mm"
2104
+ ),
2105
+ title: (item == null ? void 0 : item.type) === "create" ? `Raised by - ${(_a3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _a3.full_name}` : ((_b3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _b3.full_name) || "N/A",
2106
+ subTitle: ((_c3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _c3.comment) || "No Comments",
2107
+ attachment: ((_d3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _d3.file) || null,
2108
+ count: (item == null ? void 0 : item.current_level) == "L0" ? "L0" : item == null ? void 0 : item.current_level_count,
2109
+ cardType: "card",
2110
+ status: (item == null ? void 0 : item.type) === "approve" ? StatusObj.approved : (item == null ? void 0 : item.type) === "reject" ? StatusObj.rejected : (item == null ? void 0 : item.type) === "send_back" ? StatusObj.sendback : (item == null ? void 0 : item.type) === "onhold" ? StatusObj.onhold : null
2111
+ };
2112
+ })
2113
+ }
2114
+ ),
2115
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2116
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: "bold" }, children: [
2117
+ "Currently Assigned to:",
2118
+ " "
2119
+ ] }) }),
2244
2120
  /* @__PURE__ */ jsxRuntime.jsx(
2245
- material.Typography,
2121
+ material.Tooltip,
2246
2122
  {
2247
- variant: "body2",
2248
- sx: {
2249
- mt: 0.8,
2250
- fontWeight: 500,
2251
- color: "text.primary"
2252
- },
2253
- children: (currentLevel == null ? void 0 : currentLevel.tat_expiry) ? moment__default.default(currentLevel.tat_expiry).utcOffset("UTC+05:30").format("DD/MM/YYYY hh:mm A") : "N/A"
2123
+ title: (info == null ? void 0 : info.isLevelZero) ? (_p = (_o = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _o.created_by_user) == null ? void 0 : _p.official_email_id : (_r = (_q = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _q.assigned_user) == null ? void 0 : _r.official_email_id,
2124
+ children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", children: (info == null ? void 0 : info.isLevelZero) ? `${expandedDetails == null ? void 0 : expandedDetails[0].created_by_user.full_name} (${((_t = (_s = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _s.created_by_user) == null ? void 0 : _t.group_employee_code) || "N/A"})` : `${(_v = (_u = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _u.assigned_user) == null ? void 0 : _v.full_name} (${((_x = (_w = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _w.assigned_user) == null ? void 0 : _x.group_employee_code) || "N/A"})` })
2254
2125
  }
2255
2126
  )
2256
- ] }),
2257
- /* @__PURE__ */ jsxRuntime.jsxs(
2258
- system.Box,
2259
- {
2260
- sx: {
2261
- flexBasis: "8%",
2262
- minWidth: 80,
2263
- textAlign: "center"
2264
- },
2265
- children: [
2266
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
2267
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_k = (_j = info == null ? void 0 : info.levels) == null ? void 0 : _j.findIndex(
2268
- (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
2269
- )) != null ? _k : -1) + 1 || "") })
2270
- ]
2271
- }
2272
- ),
2273
- /* @__PURE__ */ jsxRuntime.jsxs(
2274
- system.Box,
2275
- {
2276
- sx: {
2277
- flexBasis: "18%",
2278
- minWidth: 200,
2279
- display: "flex",
2280
- alignItems: "center",
2281
- justifyContent: "flex-end",
2282
- gap: 1.5
2283
- },
2284
- children: [
2285
- (info == null ? void 0 : info.current_status) !== "completed" ? /* @__PURE__ */ jsxRuntime.jsx(
2286
- Statusselector_default,
2127
+ ] })
2128
+ ] }) })
2129
+ ]
2130
+ },
2131
+ index
2132
+ );
2133
+ }) : /* @__PURE__ */ jsxRuntime.jsx(
2134
+ "div",
2135
+ {
2136
+ style: {
2137
+ height: "100%",
2138
+ width: "100%",
2139
+ color: "gray",
2140
+ fontSize: "20px",
2141
+ display: "flex",
2142
+ justifyContent: "center",
2143
+ alignItems: "center"
2144
+ },
2145
+ children: "NO RECORD FOUND"
2146
+ }
2147
+ )
2148
+ }
2149
+ ),
2150
+ selectedApprovalOtions === "Action Required" && /* @__PURE__ */ jsxRuntime.jsx(
2151
+ system.Box,
2152
+ {
2153
+ className: "fixedModal hide-scrollbar",
2154
+ sx: {
2155
+ overflowY: "auto",
2156
+ height: "calc(100vh - 180px)",
2157
+ px: 2,
2158
+ pb: 3
2159
+ },
2160
+ children: visiblePendingRequests.length > 0 ? visiblePendingRequests == null ? void 0 : visiblePendingRequests.map((info, index) => {
2161
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
2162
+ const currentLevel = (_a2 = info == null ? void 0 : info.levels) == null ? void 0 : _a2.find(
2163
+ (level_) => level_.id === (info == null ? void 0 : info.current_level)
2164
+ );
2165
+ const statusList = currentLevel ? currentLevel.status_list : [];
2166
+ const filterRejectForLevelZero = (statusList2, info2) => {
2167
+ if (!(info2 == null ? void 0 : info2.isLevelZero)) return statusList2;
2168
+ return statusList2.filter((item) => item.status !== 3);
2169
+ };
2170
+ const redir = buildRedirectionUrl(info);
2171
+ const currentStatus = ((_d2 = (_c2 = (_b2 = info == null ? void 0 : info.levels) == null ? void 0 : _b2.find(
2172
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
2173
+ )) == null ? void 0 : _c2.selected_status) == null ? void 0 : _d2.status_id) === 1 ? "approved" : ((_g2 = (_f2 = (_e2 = info == null ? void 0 : info.levels) == null ? void 0 : _e2.find(
2174
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
2175
+ )) == null ? void 0 : _f2.selected_status) == null ? void 0 : _g2.status_id) === 3 ? "rejected" : "pending";
2176
+ const statusData = getStatus(currentStatus);
2177
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2178
+ material.Card,
2179
+ {
2180
+ ref: index === visiblePendingRequests.length - 1 ? lastCardRef : null,
2181
+ sx: {
2182
+ mb: 3,
2183
+ borderRadius: "14px",
2184
+ boxShadow: "0px 2px 10px rgba(76, 78, 100, 0.1)",
2185
+ px: 3,
2186
+ py: 2,
2187
+ background: "white !important"
2188
+ },
2189
+ children: [
2190
+ /* @__PURE__ */ jsxRuntime.jsxs(
2191
+ material.CardContent,
2192
+ {
2193
+ sx: {
2194
+ display: "flex",
2195
+ justifyContent: "space-between",
2196
+ alignItems: "center",
2197
+ flexWrap: { xs: "wrap", md: "nowrap" },
2198
+ gap: 2
2199
+ },
2200
+ children: [
2201
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "20%", minWidth: 220 }, children: [
2202
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.activityInstruction, children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "h6", fontWeight: 600, noWrap: true, children: info.activity_name }) }),
2203
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: info.description_data, children: /* @__PURE__ */ jsxRuntime.jsx(
2204
+ material.Typography,
2287
2205
  {
2288
- onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
2289
- onApprove: () => {
2290
- var _a3;
2291
- return handleApprove(
2292
- `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
2293
- );
2294
- },
2295
- onReject: () => {
2296
- var _a3;
2297
- return handleReject(
2298
- `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
2299
- );
2300
- },
2301
- onHold: () => {
2302
- var _a3;
2303
- return handleOnHold(
2304
- `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
2305
- );
2306
- },
2307
- level: info == null ? void 0 : info.isLevelZero,
2308
- statusList: filterRejectForLevelZero(
2309
- statusList,
2310
- info
2311
- )
2206
+ variant: "body2",
2207
+ color: "text.secondary",
2208
+ noWrap: true,
2209
+ sx: { mt: 0.5 },
2210
+ children: info.description_data
2312
2211
  }
2313
- ) : /* @__PURE__ */ jsxRuntime.jsx(
2314
- material.Chip,
2212
+ ) })
2213
+ ] }),
2214
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "18%", minWidth: 180 }, children: [
2215
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Links" }),
2216
+ /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: redir, children: /* @__PURE__ */ jsxRuntime.jsx(
2217
+ "a",
2315
2218
  {
2316
- variant: "filled",
2317
- sx: {
2318
- backgroundColor: statusData.color,
2319
- color: statusData.labelColor,
2320
- height: "40px",
2321
- px: 2,
2322
- borderRadius: "100px !important",
2323
- "& .MuiChip-label": {
2324
- fontSize: "14px",
2325
- lineHeight: "15.4px",
2326
- fontWeight: "500",
2327
- textTransform: "capitalize"
2328
- }
2219
+ href: redir,
2220
+ target: "_blank",
2221
+ rel: "noreferrer",
2222
+ style: {
2223
+ cursor: "pointer",
2224
+ textDecoration: "none"
2329
2225
  },
2330
- label: statusData.title
2226
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2227
+ material.Typography,
2228
+ {
2229
+ variant: "subtitle2",
2230
+ color: "primary.dark",
2231
+ sx: {
2232
+ mt: 0.8,
2233
+ lineHeight: "15.4px",
2234
+ overflow: "hidden",
2235
+ textOverflow: "ellipsis",
2236
+ whiteSpace: "nowrap"
2237
+ },
2238
+ children: redir
2239
+ }
2240
+ )
2331
2241
  }
2332
- ),
2242
+ ) })
2243
+ ] }),
2244
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "12%", minWidth: 120 }, children: [
2245
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Attachments" }),
2333
2246
  /* @__PURE__ */ jsxRuntime.jsx(
2334
- material.Divider,
2247
+ material.Typography,
2335
2248
  {
2336
- orientation: "vertical",
2337
- flexItem: true,
2249
+ variant: "body2",
2250
+ noWrap: true,
2338
2251
  sx: {
2339
- borderColor: "#E0E0E0",
2340
- height: "40px"
2341
- }
2252
+ mt: 0.8,
2253
+ color: ((_h = info == null ? void 0 : info.attachment_links) == null ? void 0 : _h.length) ? "primary.dark" : "text.disabled"
2254
+ },
2255
+ children: ((_i = info == null ? void 0 : info.attachment_links) == null ? void 0 : _i.length) ? `${info.attachment_links.length} file(s)` : "N/A"
2342
2256
  }
2343
- ),
2257
+ )
2258
+ ] }),
2259
+ /* @__PURE__ */ jsxRuntime.jsxs(system.Box, { sx: { flexBasis: "14%", minWidth: 130 }, children: [
2260
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "TAT" }),
2344
2261
  /* @__PURE__ */ jsxRuntime.jsx(
2345
- material.IconButton,
2262
+ material.Typography,
2346
2263
  {
2347
- color: "primary",
2264
+ variant: "body2",
2348
2265
  sx: {
2349
- background: "rgba(25,118,210,0.08)",
2350
- boxShadow: "2px 2px 10px 0px #4C4E6426",
2351
- "& span": { color: "primary.dark" }
2266
+ mt: 0.8,
2267
+ fontWeight: 500,
2268
+ color: "text.primary"
2352
2269
  },
2353
- onClick: () => handleExpandClick(info._id),
2354
- children: expandedId === info._id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-right-3" })
2270
+ children: (currentLevel == null ? void 0 : currentLevel.tat_expiry) ? moment__default.default(currentLevel.tat_expiry).utcOffset("UTC+05:30").format("DD/MM/YYYY hh:mm A") : "N/A"
2355
2271
  }
2356
2272
  )
2357
- ]
2358
- }
2359
- )
2360
- ]
2361
- }
2362
- ),
2363
- expandedId === info._id && /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { mt: 2, ml: 2 }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsxRuntime.jsx(
2364
- system.Box,
2365
- {
2366
- sx: {
2367
- height: 150,
2368
- display: "flex",
2369
- justifyContent: "center",
2370
- alignItems: "center"
2371
- },
2372
- children: /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 36, color: "primary" })
2373
- }
2374
- ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2375
- /* @__PURE__ */ jsxRuntime.jsx(
2376
- CustomTimelineWithStatus,
2377
- {
2378
- events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
2379
- var _a3, _b3, _c3, _d3;
2380
- return {
2381
- date: moment__default.default(item == null ? void 0 : item.created_at).format(
2382
- "DD-MM-YYYY"
2273
+ ] }),
2274
+ /* @__PURE__ */ jsxRuntime.jsxs(
2275
+ system.Box,
2276
+ {
2277
+ sx: {
2278
+ flexBasis: "8%",
2279
+ minWidth: 80,
2280
+ textAlign: "center"
2281
+ },
2282
+ children: [
2283
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", color: "text.secondary", children: "Current Level" }),
2284
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "body2", sx: { mt: 0.8 }, children: (info == null ? void 0 : info.isLevelZero) ? "L0" : "L" + (((_k = (_j = info == null ? void 0 : info.levels) == null ? void 0 : _j.findIndex(
2285
+ (lvl) => lvl.id === (info == null ? void 0 : info.current_level)
2286
+ )) != null ? _k : -1) + 1 || "") })
2287
+ ]
2288
+ }
2383
2289
  ),
2384
- time: moment__default.default(item == null ? void 0 : item.created_at).format(
2385
- "HH:mm"
2386
- ),
2387
- title: (item == null ? void 0 : item.type) === "create" ? `Raised by - ${(_a3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _a3.full_name}` : ((_b3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _b3.full_name) || "N/A",
2388
- subTitle: ((_c3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _c3.comment) || "No Comments",
2389
- attachment: ((_d3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _d3.file) || null,
2390
- count: (item == null ? void 0 : item.current_level) == "L0" ? "L0" : item == null ? void 0 : item.current_level_count,
2391
- cardType: "card",
2392
- status: (item == null ? void 0 : item.type) === "approve" ? StatusObj.approved : (item == null ? void 0 : item.type) === "reject" ? StatusObj.rejected : (item == null ? void 0 : item.type) === "send_back" ? StatusObj.sendback : (item == null ? void 0 : item.type) === "onhold" ? StatusObj.onhold : null
2393
- };
2394
- })
2395
- }
2396
- ),
2397
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2398
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: "bold" }, children: [
2399
- "Currently Assigned to:",
2400
- " "
2401
- ] }) }),
2402
- /* @__PURE__ */ jsxRuntime.jsx(
2403
- material.Tooltip,
2290
+ /* @__PURE__ */ jsxRuntime.jsxs(
2291
+ system.Box,
2292
+ {
2293
+ sx: {
2294
+ flexBasis: "18%",
2295
+ minWidth: 200,
2296
+ display: "flex",
2297
+ alignItems: "center",
2298
+ justifyContent: "flex-end",
2299
+ gap: 1.5
2300
+ },
2301
+ children: [
2302
+ (info == null ? void 0 : info.current_status) !== "completed" ? /* @__PURE__ */ jsxRuntime.jsx(
2303
+ Statusselector_default,
2304
+ {
2305
+ onSendBack: () => handleSendBack(info == null ? void 0 : info._id),
2306
+ onApprove: () => {
2307
+ var _a3;
2308
+ return handleApprove(
2309
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 1)) == null ? void 0 : _a3.id}`
2310
+ );
2311
+ },
2312
+ onReject: () => {
2313
+ var _a3;
2314
+ return handleReject(
2315
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 3)) == null ? void 0 : _a3.id}|${info == null ? void 0 : info.reasons}`
2316
+ );
2317
+ },
2318
+ onHold: () => {
2319
+ var _a3;
2320
+ return handleOnHold(
2321
+ `${info == null ? void 0 : info._id}|${(_a3 = statusList.find((i) => i.status == 2)) == null ? void 0 : _a3.id}`
2322
+ );
2323
+ },
2324
+ level: info == null ? void 0 : info.isLevelZero,
2325
+ statusList: filterRejectForLevelZero(
2326
+ statusList,
2327
+ info
2328
+ )
2329
+ }
2330
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
2331
+ material.Chip,
2332
+ {
2333
+ variant: "filled",
2334
+ sx: {
2335
+ backgroundColor: statusData.color,
2336
+ color: statusData.labelColor,
2337
+ height: "40px",
2338
+ px: 2,
2339
+ borderRadius: "100px !important",
2340
+ "& .MuiChip-label": {
2341
+ fontSize: "14px",
2342
+ lineHeight: "15.4px",
2343
+ fontWeight: "500",
2344
+ textTransform: "capitalize"
2345
+ }
2346
+ },
2347
+ label: statusData.title
2348
+ }
2349
+ ),
2350
+ /* @__PURE__ */ jsxRuntime.jsx(
2351
+ material.Divider,
2352
+ {
2353
+ orientation: "vertical",
2354
+ flexItem: true,
2355
+ sx: {
2356
+ borderColor: "#E0E0E0",
2357
+ height: "40px"
2358
+ }
2359
+ }
2360
+ ),
2361
+ /* @__PURE__ */ jsxRuntime.jsx(
2362
+ material.IconButton,
2363
+ {
2364
+ color: "primary",
2365
+ sx: {
2366
+ background: "rgba(25,118,210,0.08)",
2367
+ boxShadow: "2px 2px 10px 0px #4C4E6426",
2368
+ "& span": { color: "primary.dark" }
2369
+ },
2370
+ onClick: () => handleExpandClick(info._id),
2371
+ children: expandedId === info._id ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-down-1" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "icon-arrow-right-3" })
2372
+ }
2373
+ )
2374
+ ]
2375
+ }
2376
+ )
2377
+ ]
2378
+ }
2379
+ ),
2380
+ expandedId === info._id && /* @__PURE__ */ jsxRuntime.jsx(system.Box, { sx: { mt: 2, ml: 2 }, children: !(expandedDetails == null ? void 0 : expandedDetails.length) ? /* @__PURE__ */ jsxRuntime.jsx(
2381
+ system.Box,
2404
2382
  {
2405
- title: (info == null ? void 0 : info.isLevelZero) ? (_m = (_l = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _l.created_by_user) == null ? void 0 : _m.official_email_id : (_o = (_n = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _n.assigned_user) == null ? void 0 : _o.official_email_id,
2406
- children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", children: (info == null ? void 0 : info.isLevelZero) ? `${expandedDetails == null ? void 0 : expandedDetails[0].created_by_user.full_name} (${((_q = (_p = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _p.created_by_user) == null ? void 0 : _q.group_employee_code) || "N/A"})` : `${(_s = (_r = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _r.assigned_user) == null ? void 0 : _s.full_name} (${((_u = (_t = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _t.assigned_user) == null ? void 0 : _u.group_employee_code) || "N/A"})` })
2383
+ sx: {
2384
+ height: 150,
2385
+ display: "flex",
2386
+ justifyContent: "center",
2387
+ alignItems: "center"
2388
+ },
2389
+ children: /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 36, color: "primary" })
2407
2390
  }
2408
- )
2409
- ] })
2410
- ] }) })
2411
- ]
2412
- },
2413
- index
2414
- );
2415
- }) : /* @__PURE__ */ jsxRuntime.jsx(
2416
- "div",
2417
- {
2418
- style: {
2419
- height: "100%",
2420
- width: "100%",
2421
- color: "gray",
2422
- fontSize: "20px",
2423
- display: "flex",
2424
- justifyContent: "center",
2425
- alignItems: "center"
2426
- },
2427
- children: "NO RECORD FOUND"
2391
+ ) : /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2392
+ /* @__PURE__ */ jsxRuntime.jsx(
2393
+ CustomTimelineWithStatus,
2394
+ {
2395
+ events: expandedDetails == null ? void 0 : expandedDetails.map((item) => {
2396
+ var _a3, _b3, _c3, _d3;
2397
+ return {
2398
+ date: moment__default.default(item == null ? void 0 : item.created_at).format(
2399
+ "DD-MM-YYYY"
2400
+ ),
2401
+ time: moment__default.default(item == null ? void 0 : item.created_at).format(
2402
+ "HH:mm"
2403
+ ),
2404
+ title: (item == null ? void 0 : item.type) === "create" ? `Raised by - ${(_a3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _a3.full_name}` : ((_b3 = item == null ? void 0 : item.created_by_user) == null ? void 0 : _b3.full_name) || "N/A",
2405
+ subTitle: ((_c3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _c3.comment) || "No Comments",
2406
+ attachment: ((_d3 = item == null ? void 0 : item.comment_reasons) == null ? void 0 : _d3.file) || null,
2407
+ count: (item == null ? void 0 : item.current_level) == "L0" ? "L0" : item == null ? void 0 : item.current_level_count,
2408
+ cardType: "card",
2409
+ status: (item == null ? void 0 : item.type) === "approve" ? StatusObj.approved : (item == null ? void 0 : item.type) === "reject" ? StatusObj.rejected : (item == null ? void 0 : item.type) === "send_back" ? StatusObj.sendback : (item == null ? void 0 : item.type) === "onhold" ? StatusObj.onhold : null
2410
+ };
2411
+ })
2412
+ }
2413
+ ),
2414
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2415
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: "bold" }, children: [
2416
+ "Currently Assigned to:",
2417
+ " "
2418
+ ] }) }),
2419
+ /* @__PURE__ */ jsxRuntime.jsx(
2420
+ material.Tooltip,
2421
+ {
2422
+ title: (info == null ? void 0 : info.isLevelZero) ? (_m = (_l = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _l.created_by_user) == null ? void 0 : _m.official_email_id : (_o = (_n = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _n.assigned_user) == null ? void 0 : _o.official_email_id,
2423
+ children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "caption", children: (info == null ? void 0 : info.isLevelZero) ? `${expandedDetails == null ? void 0 : expandedDetails[0].created_by_user.full_name} (${((_q = (_p = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _p.created_by_user) == null ? void 0 : _q.group_employee_code) || "N/A"})` : `${(_s = (_r = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _r.assigned_user) == null ? void 0 : _s.full_name} (${((_u = (_t = expandedDetails == null ? void 0 : expandedDetails[0]) == null ? void 0 : _t.assigned_user) == null ? void 0 : _u.group_employee_code) || "N/A"})` })
2424
+ }
2425
+ )
2426
+ ] })
2427
+ ] }) })
2428
+ ]
2429
+ },
2430
+ index
2431
+ );
2432
+ }) : /* @__PURE__ */ jsxRuntime.jsx(
2433
+ "div",
2434
+ {
2435
+ style: {
2436
+ height: "100%",
2437
+ width: "100%",
2438
+ color: "gray",
2439
+ fontSize: "20px",
2440
+ display: "flex",
2441
+ justifyContent: "center",
2442
+ alignItems: "center"
2443
+ },
2444
+ children: "NO RECORD FOUND"
2445
+ }
2446
+ )
2428
2447
  }
2429
2448
  )
2430
- }
2431
- )
2432
- ] })
2449
+ ]
2450
+ }
2451
+ )
2433
2452
  }
2434
2453
  ),
2435
2454
  /* @__PURE__ */ jsxRuntime.jsx(