diff --git a/application/src/components/public/CurrentStatusSection.tsx b/application/src/components/public/CurrentStatusSection.tsx index f24e197..e6f1132 100644 --- a/application/src/components/public/CurrentStatusSection.tsx +++ b/application/src/components/public/CurrentStatusSection.tsx @@ -1,6 +1,6 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; -import { Shield, Clock } from 'lucide-react'; +import { Shield, Clock, CheckCircle, AlertTriangle, XCircle, Wrench } from 'lucide-react'; import { format } from 'date-fns'; import { OperationalPageRecord } from '@/types/operational.types'; import { StatusPageComponentRecord } from '@/types/statusPageComponents.types'; @@ -75,31 +75,82 @@ const getStatusColor = (status: OperationalPageRecord['status']) => { } }; +const getStatusIcon = (status: OperationalPageRecord['status']) => { + switch (status) { + case 'operational': + return ; + case 'degraded': + return ; + case 'maintenance': + return ; + case 'major_outage': + return ; + default: + return ; + } +}; + +const getStatusBackground = (status: OperationalPageRecord['status']) => { + switch (status) { + case 'operational': + return 'bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800'; + case 'degraded': + return 'bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800'; + case 'maintenance': + return 'bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800'; + case 'major_outage': + return 'bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800'; + default: + return 'bg-gray-50 dark:bg-gray-900/20 border-gray-200 dark:border-gray-800'; + } +}; + export const CurrentStatusSection = ({ page, components, services }: CurrentStatusSectionProps) => { const actualStatus = getActualStatus(components, services); + const displayStatus = actualStatus; // Use actual status for real-time accuracy return ( - + - - - Current Status + + + System Status - -
-
- - {getStatusMessage(actualStatus)} - + +
+
+ {getStatusIcon(displayStatus)} +
+

+ {getStatusMessage(displayStatus)} +

+

+ Status automatically updated based on component health +

+
+
+
+ {displayStatus === 'operational' ? 'All Systems Operational' : + displayStatus === 'degraded' ? 'Degraded Performance' : + displayStatus === 'maintenance' ? 'Under Maintenance' : 'Major Outage'} +
-
- - Last updated {format(new Date(page.updated), 'MMM dd, yyyy HH:mm')} UTC + +
+
+ + Last updated: {format(new Date(), 'MMM dd, yyyy HH:mm')} UTC +
+
+
+ Live status monitoring +