From 69f39e76a04560f16f957b1600a3db25a3172c04 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 27 Feb 2025 11:27:20 -0800 Subject: [PATCH] add link and style for public status page --- .../Components/StatusPagesTable/index.jsx | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx b/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx index 746d10f42..620fa53ea 100644 --- a/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx +++ b/src/Pages/StatusPage/StatusPages/Components/StatusPagesTable/index.jsx @@ -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 ( - {`/${row.url}`} - + {content} + {row.isPublished && } ); },