feat: Phase 8 - Frontend main views (T-026 to T-031)
Implement all main frontend views for the MITRE ATT&CK coverage platform: - T-026: Dashboard with coverage summary cards and tactic breakdown table - T-027: Interactive ATT&CK matrix with filtering by status, tactic, platform - T-028: Technique detail page with tests, intel items, and review actions - T-029: Test creation form with technique selector and validation - T-030: Test detail page with drag and drop evidence upload and download - T-031: System admin panel with MITRE sync and intel scan controls New components: CoverageSummaryCard, TacticCoverageChart, AttackMatrix, TechniqueCell, TestForm, EvidenceUpload, EvidenceList New API modules: metrics.ts, techniques.ts, tests.ts, evidence.ts, system.ts All views use TanStack Query for data fetching with proper loading and error states. Role-based UI controls for admin/lead actions.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
interface CoverageSummaryCardProps {
|
||||
title: string;
|
||||
value: number;
|
||||
total?: number;
|
||||
icon: ReactNode;
|
||||
colorClass: string;
|
||||
bgClass: string;
|
||||
}
|
||||
|
||||
export default function CoverageSummaryCard({
|
||||
title,
|
||||
value,
|
||||
total,
|
||||
icon,
|
||||
colorClass,
|
||||
bgClass,
|
||||
}: CoverageSummaryCardProps) {
|
||||
const percentage = total && total > 0 ? ((value / total) * 100).toFixed(1) : null;
|
||||
|
||||
return (
|
||||
<div className={`rounded-xl border border-gray-800 ${bgClass} p-5`}>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<p className="text-sm font-medium text-gray-400">{title}</p>
|
||||
<p className={`mt-1 text-3xl font-bold ${colorClass}`}>{value}</p>
|
||||
{percentage !== null && (
|
||||
<p className="mt-1 text-xs text-gray-500">{percentage}% of total</p>
|
||||
)}
|
||||
</div>
|
||||
<div className={`rounded-lg p-3 ${bgClass} border border-gray-700`}>
|
||||
{icon}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user