-
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
Justin Campbell
committed
Aug 17, 2020
1 parent
af12e5f
commit 700bafc
Showing
2 changed files
with
47 additions
and
46 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,43 @@ | ||
import React from 'react'; | ||
import { makeStyles, Grid, Paper } from '@material-ui/core'; | ||
import { Alert } from '@material-ui/lab' | ||
|
||
|
||
export default function ItemMetadataView({item}){ | ||
const LockedAlert = () => { | ||
return ( | ||
<Alert severity="warning"> | ||
{item.isLocked} | ||
</Alert> | ||
); | ||
} | ||
const useStyles = makeStyles({ | ||
"gridContainer": { | ||
paddingTop: ".75em", | ||
} | ||
}); | ||
|
||
const classes = useStyles(); | ||
|
||
const metadataFields = ["userEmail", "userAlias", "subject", "dateReceived", | ||
"assignedTo", "status", "priority", "department", "building"]; | ||
|
||
return( | ||
<> | ||
{item.isLocked ? LockedAlert() : ""} | ||
<Grid container spacing={2} classes={{root: classes.gridContainer}}> | ||
{metadataFields.map((field) => { | ||
const title = field.toUpperCase(); | ||
const subtitle = item[field] === undefined ? "Unknown" : item[field]; | ||
return ( | ||
<Grid item xs={12} md={4} xl={6}> | ||
<Paper> | ||
<b>{title}</b>: {subtitle} | ||
</Paper> | ||
</Grid> | ||
); | ||
})} | ||
</Grid> | ||
</> | ||
); | ||
} |
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