Skip to content

Commit

Permalink
eligibility mat changes w errs to be resolved in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishnansh5 committed Oct 28, 2023
1 parent d49818e commit 6e436f9
Show file tree
Hide file tree
Showing 6 changed files with 609 additions and 918 deletions.
44 changes: 25 additions & 19 deletions components/Utils/MatrixExpanded.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-nested-ternary */
import RemoveIcon from "@mui/icons-material/Remove";
import {
Paper,
Table,
Expand All @@ -16,8 +15,7 @@ import CheckIcon from "@mui/icons-material/Check";
import {
Branches,
func,
programPhDExpanded,
programType,
totalDeptKeywords,
} from "@components/Utils/matrixUtils";

function MatrixExpanded({ data }: { data: string }) {
Expand All @@ -32,23 +30,31 @@ function MatrixExpanded({ data }: { data: string }) {
<TableCell component="th" scope="row" sx={{ fontWeight: 600 }}>
{branch}
</TableCell>
{programPhDExpanded.map((program) => (
<TableCell width={100} align="center">
{func[branch as keyof typeof func][
program as keyof programType
] === -1 ? (
<RemoveIcon />
) : data[
func[branch as keyof typeof func][
program as keyof programType
]
] === "1" ? (
<CheckIcon sx={{ color: "green" }} />
) : (
<CloseIcon sx={{ color: "red" }} />
<TableCell>
<Table sx={{ minWidth: 650 }} aria-label="keywords table">
{Object.keys(func[branch as keyof typeof func]).map(
(keyword) => {
const temp = func[branch as keyof typeof func];
const value =
func[branch as keyof typeof func][
keyword as keyof typeof temp
];
return (
<TableRow>
<TableCell>{keyword}</TableCell>
<TableCell>
{data[value] === "1" ? (
<CheckIcon sx={{ color: "green" }} />
) : (
<CloseIcon sx={{ color: "red" }} />
)}
</TableCell>
</TableRow>
);
}
)}
</TableCell>
))}
</Table>
</TableCell>
</TableRow>
))}
</TableBody>
Expand Down
Loading

0 comments on commit 6e436f9

Please sign in to comment.