import type { Issue } from '../lib/types'; import IssueRow from './IssueRow'; interface Props { issues: Issue[]; selectedId: string | null; onSelect: (issue: Issue) => void; } export default function IssueList({ issues, selectedId, onSelect }: Props) { if (issues.length === 0) { return (

No issues found. Run a scan to check your site.

); } // Sort: critical first, then warnings, then notices. const ORDER: Record = { critical: 0, warning: 1, notice: 2 }; const sorted = [...issues].sort( (a, b) => (ORDER[a.severity] ?? 3) - (ORDER[b.severity] ?? 3) ); return (
{sorted.map((issue) => ( onSelect(issue)} /> ))}
); }