-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: display job exit code on result card
Resolves #1320
- Loading branch information
1 parent
ef5c6d1
commit 242dd9a
Showing
2 changed files
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { useGetTask } from "@squonk/data-manager-client/task"; | ||
|
||
import { ExitToApp as ExitToAppIcon } from "@mui/icons-material"; | ||
import { ListItem, ListItemIcon, ListItemText } from "@mui/material"; | ||
|
||
export interface ExitCodeFromTaskProps { | ||
taskId: string; | ||
} | ||
|
||
export const ExitCodeFromTask = ({ taskId }: ExitCodeFromTaskProps) => { | ||
const { data } = useGetTask(taskId); | ||
const code = data?.exit_code; | ||
|
||
return ( | ||
<ListItem> | ||
<ListItemIcon sx={{ minWidth: "40px" }}> | ||
<ExitToAppIcon /> | ||
</ListItemIcon> | ||
<ListItemText | ||
primary="Exit Code" | ||
secondary={code} | ||
secondaryTypographyProps={{ | ||
color: code === 0 ? "green" : "error", | ||
fontWeight: "bold", | ||
}} | ||
/> | ||
</ListItem> | ||
); | ||
}; |
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