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