import AppLayout from '@/Layouts/AppLayout'; import { Head, router } from '@inertiajs/react'; import { motion } from 'framer-motion'; import { Shield, AlertTriangle, CheckCircle, TrendingUp, Scan, Lock, Bug } from 'lucide-react'; import { GlassCard, StatCard } from '@/Components/ui/GlassCard'; import { StatusBadge } from '@/Components/ui/StatusBadge'; import { Button } from '@/Components/ui/Button'; import { ProgressBar } from '@/Components/ui/ProgressBar'; import { DataTable } from '@/Components/ui/DataTable'; import { timeAgo, getSecurityGradeColor } from '@/lib/utils'; import { RadarChart, Radar, PolarGrid, PolarAngleAxis, ResponsiveContainer } from 'recharts'; import { cn } from '@/lib/utils'; const radarData = [ { subject: 'Patching', A: 85 }, { subject: 'Access Ctrl', A: 72 }, { subject: 'Encryption', A: 90 }, { subject: 'Network', A: 65 }, { subject: 'Monitoring', A: 78 }, { subject: 'Compliance', A: 60 }, ]; function ScoreRing({ score, grade }) { const color = grade === 'A' ? '#00ff88' : grade === 'B' ? '#00d4ff' : grade === 'C' ? '#ffd700' : grade === 'D' ? '#ff6b35' : '#ff2d55'; const r = 60, circumference = 2 * Math.PI * r; const dash = (score / 100) * circumference; return (

{score}

/ 100

); } export default function SecurityIndex({ scores, scans, stats }) { const avgScore = scores?.avg ?? 72; const grade = avgScore >= 90 ? 'A' : avgScore >= 75 ? 'B' : avgScore >= 60 ? 'C' : avgScore >= 45 ? 'D' : 'F'; const scanColumns = [ { header: 'Target', accessor: 'target_name', render: row => (

{row.target_name}

{row.target_type} · {row.scan_type}

)}, { header: 'Score', accessor: 'score', render: row => (
{row.grade} {row.score ?? '—'}
)}, { header: 'Findings', key: 'findings', render: row => (
{row.critical_count > 0 && {row.critical_count}C} {row.high_count > 0 && {row.high_count}H} {row.medium_count > 0 && {row.medium_count}M} {row.low_count > 0 && {row.low_count}L}
)}, { header: 'Status', accessor: 'status', render: row => }, { header: 'Scanned', accessor: 'completed_at', render: row => ( {timeAgo(row.completed_at)} )}, ]; return (

Cybersecurity Dashboard

Security posture across all infrastructure

{/* Score + Radar */}

Overall Security Score

Grade {grade}

Based on {scans?.total ?? 0} scans across infrastructure

Security Radar

Coverage across security domains

{/* Stats */}
{/* Scan results table */}

Recent Scans

); }