Merge pull request #1838 from bluewave-labs/feat/status-table-onclick

feat: status table onclick
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-02-27 14:31:52 -08:00
commit 777a518da6
2 files changed
+31 -3

No files matched your search

@@ -17,16 +17,40 @@ 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);
}
},
render: (row) => {
const content = row.isPublished ? `/${row.url}` : "Unpublished";
return (
<Stack
direction="row"
alignItems="center"
justifyContent="center"
gap={theme.spacing(2)}
paddingLeft={theme.spacing(2)}
paddingRight={theme.spacing(2)}
borderRadius={theme.spacing(4)}
sx={{
...(row.isPublished && {
":hover": {
backgroundColor: `${theme.palette.primary.light}`,
cursor: "pointer",
borderRadius: 1,
},
}),
}}
>
<Typography>{`/${row.url}`}</Typography>
<ArrowOutwardIcon />
<Typography>{content}</Typography>
{row.isPublished && <ArrowOutwardIcon />}
</Stack>
);
},