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:
38
admin/src/components/reqlog/LogsOverview.tsx
Normal file
38
admin/src/components/reqlog/LogsOverview.tsx
Normal file
@ -0,0 +1,38 @@
|
||||
import { useState } from "react";
|
||||
import { Box, Paper, Container, Typography } from "@material-ui/core";
|
||||
|
||||
import RequestList from "./RequestList";
|
||||
import LogDetail from "./LogDetail";
|
||||
|
||||
function LogsOverview(): JSX.Element {
|
||||
const [detailReqLogId, setDetailReqLogId] = useState<string | null>(null);
|
||||
|
||||
const handleLogClick = (reqId: string) => setDetailReqLogId(reqId);
|
||||
|
||||
return (
|
||||
<Box style={{ padding: 8 }}>
|
||||
<Box mb={2}>
|
||||
<RequestList onLogClick={handleLogClick} />
|
||||
</Box>
|
||||
<Box>
|
||||
{detailReqLogId ? (
|
||||
<LogDetail requestId={detailReqLogId} />
|
||||
) : (
|
||||
<Paper
|
||||
elevation={0}
|
||||
style={{
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
height: "60vh",
|
||||
}}
|
||||
>
|
||||
<Typography>Select a log entry…</Typography>
|
||||
</Paper>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
export default LogsOverview;
|
Reference in New Issue
Block a user