mirror of
https://github.com/dstotijn/hetty.git
synced 2025-07-01 18:47:29 -04:00
Add Layout
component, syntax highlighting and tidy up
This commit is contained in:
19
admin/src/components/reqlog/HttpStatusCode.tsx
Normal file
19
admin/src/components/reqlog/HttpStatusCode.tsx
Normal file
@ -0,0 +1,19 @@
|
||||
import { green, orange, red } from "@material-ui/core/colors";
|
||||
import FiberManualRecordIcon from "@material-ui/icons/FiberManualRecord";
|
||||
|
||||
function HttpStatusIcon({ status }: { status: number }): JSX.Element {
|
||||
const style = { marginTop: "-.25rem", verticalAlign: "middle" };
|
||||
switch (Math.floor(status / 100)) {
|
||||
case 2:
|
||||
case 3:
|
||||
return <FiberManualRecordIcon style={{ ...style, color: green[400] }} />;
|
||||
case 4:
|
||||
return <FiberManualRecordIcon style={{ ...style, color: orange[400] }} />;
|
||||
case 5:
|
||||
return <FiberManualRecordIcon style={{ ...style, color: red[400] }} />;
|
||||
default:
|
||||
return <FiberManualRecordIcon style={style} />;
|
||||
}
|
||||
}
|
||||
|
||||
export default HttpStatusIcon;
|
Reference in New Issue
Block a user