// HomePage.jsx — full-page assembly of the CVE Dashboard Home view. // Rebuilt 1:1 from frontend/src/App.js (currentPage === 'home'). // // Layout: top stat row (4 metric cards) → 12-col grid below // • col-span-9 (left): Quick CVE Lookup → Search/Filter → CVE list // • col-span-3 (right): Calendar → Open Tickets → Archer → Ivanti const { COLORS: HC, StatCard, HomeCard, CardTitle, HomeButton, SeverityBadge, StatusBadge, HomeInput, HomeSelect, FieldLabel, ResultBanner, BigStat, MiniTicket, CVERow, VendorEntry, HomeIcon: HI, CalendarMini, ArchiveSummary, ScrollList, EmptyState, withAlpha: hAlpha, } = window.HOME; const { useState: useHomePageState } = React; /* ── Sample data — close to what App.js renders against ──────── */ const SAMPLE_CVES = [ { id: 'CVE-2025-1014', severity: 'Critical', description: 'Heap-based buffer overflow in the libnetfilter_queue user-space packet handler permits a remote attacker to execute arbitrary code via crafted ICMP traffic.', statuses: ['Open', 'In Progress'], vendors: [ { vendor: 'Red Hat', severity: 'Critical', status: 'Open', docCount: 4 }, { vendor: 'Ubuntu', severity: 'Critical', status: 'In Progress', docCount: 2 }, { vendor: 'SUSE', severity: 'High', status: 'Resolved', docCount: 3 }, ], tickets: [ { key: 'SEC-4821', summary: 'Patch netfilter on prod ingress fleet', status: 'In Progress' }, ], }, { id: 'CVE-2025-0944', severity: 'High', description: 'Authentication bypass in admin console allows unauthenticated access to telemetry exports.', statuses: ['Addressed'], vendors: [ { vendor: 'Cisco', severity: 'High', status: 'Addressed', docCount: 2 }, ], }, { id: 'CVE-2024-9912', severity: 'Medium', description: 'Improper cert validation in the JIRA Server REST client could lead to MITM under attacker-controlled DNS.', statuses: ['Resolved'], vendors: [ { vendor: 'Atlassian', severity: 'Medium', status: 'Resolved', docCount: 1 }, ], }, ]; const SAMPLE_OPEN_TICKETS = [ { key: 'SEC-4821', cveId: 'CVE-2025-1014', vendor: 'Red Hat', status: 'In Progress', summary: 'Patch netfilter ingress' }, { key: 'SEC-4794', cveId: 'CVE-2025-0944', vendor: 'Cisco', status: 'Open', summary: 'Roll admin-console hotfix' }, { key: 'SEC-4760', cveId: 'CVE-2024-9912', vendor: 'Atlassian', status: 'Open', summary: 'Validate cert chain' }, ]; const SAMPLE_ARCHER = [ { key: 'EXC-08291', cveId: 'CVE-2025-1014', vendor: 'SUSE', status: 'Pending Review' }, { key: 'EXC-08214', cveId: 'CVE-2024-9912', vendor: 'Adobe', status: 'Draft' }, ]; const SAMPLE_IVANTI = [ { id: 'WF-1042', name: 'Quarterly compliance scan', state: 'In Review', type: 'compliance audit', when: 'Apr 24' }, { id: 'WF-1038', name: 'Endpoint patch rollout — Linux fleet', state: 'In Progress', type: 'patch deploy', when: 'Apr 22' }, { id: 'WF-1034', name: 'Identity provider rotation', state: 'Approved', type: 'access change', when: 'Apr 21' }, ]; const ARCHIVE_SUMMARY = [ { label: 'In Review', count: 12, tone: 'amber' }, { label: 'In Progress', count: 8, tone: 'sky' }, { label: 'Approved', count: 17, tone: 'green' }, { label: 'Closed', count: 41, tone: 'neutral' }, ]; /* ── Page ────────────────────────────────────────────────────── */ function HomePage() { const [expanded, setExpanded] = useHomePageState(SAMPLE_CVES[0].id); const [scanResult, setScanResult] = useHomePageState({ tone: 'success', text: 'CVE-2025-1014 addressed (3 vendors)' }); const [search, setSearch] = useHomePageState(''); const [vendor, setVendor] = useHomePageState('All Vendors'); const [severity, setSeverity] = useHomePageState('All Severities'); return (
{SAMPLE_CVES.length} CVEs • {SAMPLE_CVES.reduce((n, c) => n + c.vendors.length, 0)} vendor entries