add link and style for public status page

This commit is contained in:
Alex Holliday committed 2025-02-27 11:27:20 -08:00
1 parent ac8c01fd81
commit 69f39e76a0
1 file changed
+25 -3
@@ -17,16 +17,38 @@ const StatusPagesTable = ({ data }) => {
}, },
{ {
id: "url", id: "url",
content: "URL", content: "Public URL",
onClick: (e, row) => {
if (row.isPublished) {
e.stopPropagation();
const url =
row.type === "distributed"
? `/status/distributed/public/${row.url}`
: `/status/uptime/public/${row.url}`;
navigate(url);
}
},
getCellSx: (row) => {
return {
...(row.isPublished && {
"&.MuiTableCell-root:hover": {
backgroundColor: `${theme.palette.primary.light}`,
cursor: "pointer",
borderRadius: 1,
},
}),
};
},
render: (row) => { render: (row) => {
const content = row.isPublished ? `/${row.url}` : "Unpublished";
return ( return (
<Stack <Stack
direction="row" direction="row"
alignItems="center" alignItems="center"
gap={theme.spacing(2)} gap={theme.spacing(2)}
> >
<Typography>{`/${row.url}`}</Typography> <Typography>{content}</Typography>
<ArrowOutwardIcon /> {row.isPublished && <ArrowOutwardIcon />}
</Stack> </Stack>
); );
}, },