From 09077c450606b7df9f52b0efa613c65b02ce5bc4 Mon Sep 17 00:00:00 2001 From: Bennet Gallein Date: Sat, 10 May 2025 11:25:22 +0200 Subject: [PATCH] feat: allow link to be passed from outside - and external or internal --- components/MonitorDetail.tsx | 9 ++++++--- components/MonitorList.tsx | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/components/MonitorDetail.tsx b/components/MonitorDetail.tsx index 66f95c6..41faad6 100644 --- a/components/MonitorDetail.tsx +++ b/components/MonitorDetail.tsx @@ -5,13 +5,16 @@ import DetailChart from './DetailChart' import DetailBar from './DetailBar' import { getColor } from '@/util/color' import { maintenances } from '@/uptime.config' +import Link from 'next/link' export default function MonitorDetail({ monitor, state, + link, }: { monitor: MonitorTarget state: MonitorState + link?: string }) { if (!state.latency[monitor.id]) return ( @@ -65,10 +68,10 @@ export default function MonitorDetail({ // Conditionally render monitor name with or without hyperlink based on monitor.url presence const monitorNameElement = ( - {monitor.statusPageLink ? ( + {link ? ( {statusIcon} {monitor.name} diff --git a/components/MonitorList.tsx b/components/MonitorList.tsx index f1f9d2f..f5815fc 100644 --- a/components/MonitorList.tsx +++ b/components/MonitorList.tsx @@ -76,7 +76,11 @@ export default function MonitorList({ .map((monitor) => (
- +
))}