/* * File: CriticalAlerts.tsx * Description: Critical alerts component displaying emergency notifications * Design & Developed by Tech4Biz Solutions * Copyright (c) Spurrin Innovations. All rights reserved. */ import React from 'react'; import { View, Text, TouchableOpacity, StyleSheet, ScrollView, } from 'react-native'; import { theme } from '../../../theme/theme'; import { Alert } from '../../../shared/types/alerts'; interface CriticalAlertsProps { alerts: Alert[]; onAlertPress: (alert: Alert) => void; } export const CriticalAlerts: React.FC = ({ alerts, onAlertPress, }) => { if (alerts.length === 0) { return null; } return ( 🚨 Critical Alerts {alerts.length} {alerts.map((alert) => ( onAlertPress(alert)} activeOpacity={0.7} > {alert.type.replace('_', ' ')} {new Date(alert.timestamp).toLocaleTimeString()} {alert.title} {alert.message} {alert.patientName && ( {alert.patientName} {alert.bedNumber && ( Bed {alert.bedNumber} )} )} {alert.actionRequired && ( Action Required )} ))} ); }; const styles = StyleSheet.create({ container: { backgroundColor: theme.colors.criticalBackground, borderColor: theme.colors.critical, borderWidth: 1, borderRadius: theme.borderRadius.large, padding: theme.spacing.md, marginBottom: theme.spacing.lg, ...theme.shadows.critical, }, header: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: theme.spacing.md, }, title: { fontSize: theme.typography.fontSize.displaySmall, fontFamily: theme.typography.fontFamily.bold, color: theme.colors.critical, }, count: { fontSize: theme.typography.fontSize.bodyLarge, fontFamily: theme.typography.fontFamily.bold, color: theme.colors.critical, backgroundColor: theme.colors.background, paddingHorizontal: theme.spacing.sm, paddingVertical: theme.spacing.xs, borderRadius: theme.borderRadius.small, }, scrollContainer: { paddingRight: theme.spacing.md, }, alertCard: { backgroundColor: theme.colors.background, borderRadius: theme.borderRadius.medium, padding: theme.spacing.md, marginRight: theme.spacing.md, minWidth: 280, ...theme.shadows.small, }, alertHeader: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: theme.spacing.sm, }, alertType: { fontSize: theme.typography.fontSize.bodySmall, color: theme.colors.critical, textTransform: 'uppercase', }, alertTime: { fontSize: theme.typography.fontSize.caption, color: theme.colors.textMuted, }, alertTitle: { fontSize: theme.typography.fontSize.bodyLarge, fontFamily: theme.typography.fontFamily.bold, color: theme.colors.textPrimary, marginBottom: theme.spacing.xs, }, alertMessage: { fontSize: theme.typography.fontSize.bodyMedium, color: theme.colors.textSecondary, marginBottom: theme.spacing.sm, lineHeight: theme.typography.lineHeight.normal * theme.typography.fontSize.bodyMedium, }, patientInfo: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: theme.spacing.sm, }, patientName: { fontSize: theme.typography.fontSize.bodyMedium, color: theme.colors.textPrimary, }, bedNumber: { fontSize: theme.typography.fontSize.bodySmall, color: theme.colors.textSecondary, backgroundColor: theme.colors.backgroundAccent, paddingHorizontal: theme.spacing.sm, paddingVertical: theme.spacing.xs, borderRadius: theme.borderRadius.small, }, actionRequired: { backgroundColor: theme.colors.critical, borderRadius: theme.borderRadius.small, paddingHorizontal: theme.spacing.sm, paddingVertical: theme.spacing.xs, alignSelf: 'flex-start', }, actionText: { fontSize: theme.typography.fontSize.caption, color: theme.colors.background, textTransform: 'uppercase', }, }); /* * End of File: CriticalAlerts.tsx * Design & Developed by Tech4Biz Solutions * Copyright (c) Spurrin Innovations. All rights reserved. */