import React, { useEffect, useState } from 'react'; import { useConfig } from '../hooks/useApi'; type Page = 'dashboard' | 'checklist' | 'documents' | 'scanner' | 'incidents' | 'education' | 'settings'; interface NavigationProps { currentPage: Page; onNavigate: (page: Page) => void; badges?: { incidents?: number; // overdue incidents scanner?: number; // critical vulnerabilities }; } const NAV_ITEMS: { id: Page; label: string; icon: string; premium?: boolean }[] = [ { id: 'dashboard', label: 'Dashboard', icon: 'dashboard' }, { id: 'checklist', label: 'Compliance Checklist', icon: 'checklist' }, { id: 'documents', label: 'Document Generator', icon: 'documents' }, { id: 'education', label: 'CRA Guide', icon: 'education' }, { id: 'scanner', label: 'Vulnerability Scanner', icon: 'scanner', premium: true }, { id: 'incidents', label: 'Incident Center', icon: 'incidents', premium: true }, { id: 'settings', label: 'Settings', icon: 'settings' }, ]; export function Navigation({ currentPage, onNavigate, badges }: NavigationProps) { const config = useConfig(); const isPremium = config.plan !== 'free'; return (

ResilienceWP

{config.plan.toUpperCase()}
); } function CraCountdown() { const REPORTING_DEADLINE = new Date('2026-09-11T00:00:00Z').getTime(); const [now, setNow] = useState(Date.now()); useEffect(() => { const id = setInterval(() => setNow(Date.now()), 60_000); return () => clearInterval(id); }, []); const diff = REPORTING_DEADLINE - now; if (diff <= 0) { return (
CRA Reporting Active Now
); } const days = Math.floor(diff / 86_400_000); const hours = Math.floor((diff % 86_400_000) / 3_600_000); return (
CRA Reporting Deadline {days}d {hours}h
); } function renderIcon(name: string) { const common = { viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 2, strokeLinecap: 'round' as const, strokeLinejoin: 'round' as const, width: 16, height: 16, }; if (name === 'dashboard') { return ( ); } if (name === 'checklist') { return ( ); } if (name === 'documents') { return ( ); } if (name === 'education') { return ( ); } if (name === 'scanner') { return ( ); } if (name === 'incidents') { return ( ); } return ( ); }