From 52b98acdf42ddd6a55aa03df600342e0e67c3a44 Mon Sep 17 00:00:00 2001 From: lyc8503 Date: Sun, 21 Sep 2025 21:27:11 +0800 Subject: [PATCH] keep original styles --- components/MaintenanceAlert.tsx | 93 +++++++++++++++++---------------- 1 file changed, 48 insertions(+), 45 deletions(-) diff --git a/components/MaintenanceAlert.tsx b/components/MaintenanceAlert.tsx index c4a84d7..82a136c 100644 --- a/components/MaintenanceAlert.tsx +++ b/components/MaintenanceAlert.tsx @@ -1,4 +1,4 @@ -import { Alert, List, Text, Group, Box, useMantineTheme } from '@mantine/core' +import { Alert, List, Text, useMantineTheme } from '@mantine/core' import { useMediaQuery } from '@mantine/hooks' import { IconAlertTriangle } from '@tabler/icons-react' import { MaintenanceConfig, MonitorTarget } from '@/types/config' @@ -20,57 +20,60 @@ export default function MaintenanceAlert({ } title={ - upcoming - ? `Upcoming Maintenance: ${maintenance.title || 'Scheduled Maintenance'}` - : maintenance.title || 'Scheduled Maintenance' + + {upcoming + ? `Upcoming Maintenance: ${maintenance.title || 'Scheduled Maintenance'}` + : maintenance.title || 'Scheduled Maintenance'} + } - color={upcoming ? (pageConfig.maintenances?.upcomingColor ?? "gray") : maintenance.color || '#f29030'} + color={upcoming ? (pageConfig.maintenances?.upcomingColor ?? 'gray') : maintenance.color || 'yellow'} withCloseButton={false} style={{ margin: '16px auto', ...style }} > - {/* Body and dates in a responsive flex layout */} - - {/* Maintenance description and affected components */} - - {maintenance.body} + {upcoming ? 'Scheduled for' : 'From'}: {new Date(maintenance.start).toLocaleString()} +
+ {upcoming ? 'Expected end' : 'To'}:{' '} + {maintenance.end + ? new Date(maintenance.end).toLocaleString() + : 'Until further notice'} + - {maintenance.monitors && maintenance.monitors.length > 0 && ( - <> - Affected components: - - {maintenance.monitors.map((comp, idx) => ( - {comp.name} - ))} - - - )} -
- - {/* Date range */} - - {upcoming ? 'Scheduled for' : 'From'}:{' '}{new Date(maintenance.start).toLocaleString()} -
- {upcoming ? 'Expected end' : 'To'}:{' '} - {maintenance.end - ? new Date(maintenance.end).toLocaleString() - : 'Until further notice'} -
-
+ {maintenance.body} + {maintenance.monitors && maintenance.monitors.length > 0 && ( + <> + + Affected components: + + + {maintenance.monitors.map((comp, compIdx) => ( + {comp.name} + ))} + + + )}
) -} \ No newline at end of file +}