add link and style for public status page

This commit is contained in:
Alex Holliday
2025-02-27 11:27:20 -08:00
parent ac8c01fd81
commit 69f39e76a0

View File

@@ -17,16 +17,38 @@ const StatusPagesTable = ({ data }) => {
},
{
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) => {
const content = row.isPublished ? `/${row.url}` : "Unpublished";
return (
<Stack
direction="row"
alignItems="center"
gap={theme.spacing(2)}
>
<Typography>{`/${row.url}`}</Typography>
<ArrowOutwardIcon />
<Typography>{content}</Typography>
{row.isPublished && <ArrowOutwardIcon />}
</Stack>
);
},