amp-workflow-ui 0.1.12 → 0.1.13

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