-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acd7f25
commit 7907182
Showing
3 changed files
with
232 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Chip, Link } from "@mui/material"; | ||
import { Link as RouterLink } from "react-router-dom"; | ||
import { Capability } from "./capabilityTypes"; | ||
export const ChildCapabilityRow = ({ | ||
capability, | ||
path, | ||
}: { | ||
capability: Capability; | ||
path: string; | ||
}) => { | ||
const pass = capability.result === "pass"; | ||
return ( | ||
<tr> | ||
<td> | ||
<Link to={path} component={RouterLink}> | ||
{capability.name} ({capability.participant_id}) | ||
</Link> | ||
</td> | ||
<td> | ||
<Chip | ||
label={pass ? "PASS" : "FAIL"} | ||
color={pass ? "success" : "error"} | ||
/> | ||
</td> | ||
</tr> | ||
); | ||
}; | ||
|
||
export const ChildCapabilityTable = ({ | ||
capability, | ||
}: { | ||
capability: Capability; | ||
}) => { | ||
const childCapabilities = capability.childCapabilities.map((c, i) => ( | ||
<ChildCapabilityRow capability={c} path={i.toString()} /> | ||
)); | ||
|
||
return ( | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Child Capability</th> | ||
<th>Result</th> | ||
</tr> | ||
</thead> | ||
<tbody>{childCapabilities}</tbody> | ||
</table> | ||
); | ||
}; |
Oops, something went wrong.