< Summary - Frontend Coverage Report (WSL)

Information
Class: src/components/AlertsPanel.js
Assembly: Default
File(s): src/components/AlertsPanel.js
Line coverage
100%
Covered lines: 49
Uncovered lines: 0
Coverable lines: 49
Total lines: 49
Line coverage: 100%
Branch coverage
100%
Covered branches: 10
Total branches: 10
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

File(s)

src/components/AlertsPanel.js

#LineLine coverage
 11import React from 'react';
 12import { useMaintenance } from '../context/MaintenanceContext.js';
 13import { Bell, ShieldAlert, Info } from 'lucide-react';
 14
 15export function AlertsPanel() {
 186    const { alerts } = useMaintenance();
 187
 188    return (
 189        <div style={{ padding: '10px' }}>
 1810            <div style={{ display: 'flex', alignItems: 'center', gap: '10px', marginBottom: '15px' }}>
 1811                <Bell size={20} color="#e67e22" />
 1812                <h3 style={{ margin: 0, fontSize: '1.2rem' }}>System Notifications</h3>
 1813            </div>
 1814
 1815            <div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
 1816                {alerts.map((alert) => (
 317                    <div key={alert.id} style={{
 318                        padding: '12px',
 319                        borderRadius: '8px',
 320                        backgroundColor: alert.severity === 'CRITICAL' ? '#fdf2f2' : '#f0f7ff',
 321                        border: `1px solid ${alert.severity === 'CRITICAL' ? '#fbd5d5' : '#d1e9ff'}`,
 322                        fontSize: '0.85rem'
 323                    }}>
 324                        <div style={{ display: 'flex', gap: '10px' }}>
 325                            {alert.severity === 'CRITICAL' ? (
 226                                <ShieldAlert size={18} color="#c81e1e" />
 127                            ) : (
 128                                <Info size={18} color="#1c64f2" />
 329                            )}
 330                            <div style={{ flex: 1 }}>
 331                                <div style={{
 332                                    fontWeight: 'bold',
 333                                    color: alert.severity === 'CRITICAL' ? '#9b1c1c' : '#1e429f',
 334                                    marginBottom: '2px'
 335                                }}>
 336                                    {alert.severity}
 337                                </div>
 338                                <div style={{ color: '#4b5563', lineHeight: '1.4' }}>{alert.message}</div>
 339                                <div style={{ marginTop: '8px', fontSize: '0.75rem', color: '#9ca3af' }}>
 340                                    {alert.created_at}
 341                                </div>
 342                            </div>
 343                        </div>
 344                    </div>
 1845                ))}
 1846            </div>
 1847        </div>
 1848    );
 1849}

Methods/Properties

AlertsPanel