/** * MetricsOverview component - Display aggregated metrics in stat cards */ import React from 'react'; import { Box, Typography, Paper, Grid, } from '@mui/material'; import { Work as JobsIcon, Speed as AccuracyIcon, TableRows as RowsIcon, Storage as DataIcon, } from '@mui/icons-material'; interface MetricsOverviewProps { totalJobs: number; avgAccuracy: number; totalRowsCleaned: number; totalDataProcessed: number; } const MetricsOverview: React.FC = ({ totalJobs, avgAccuracy, totalRowsCleaned, totalDataProcessed, }) => { const formatDataSize = (bytes: number): string => { if (bytes >= 1073741824) { return `${(bytes / 1073741824).toFixed(1)} GB`; } if (bytes >= 1048576) { return `${(bytes / 1048576).toFixed(1)} MB`; } if (bytes >= 1024) { return `${(bytes / 1024).toFixed(1)} KB`; } return `${bytes} B`; }; const statCards = [ { icon: , label: 'Total Jobs', value: totalJobs.toLocaleString(), color: '#1976d2', }, { icon: , label: 'Avg Accuracy', value: `${(avgAccuracy * 100).toFixed(1)}%`, color: '#2e7d32', }, { icon: , label: 'Total Rows Cleaned', value: totalRowsCleaned.toLocaleString(), color: '#ed6c02', }, { icon: , label: 'Total Data Processed', value: formatDataSize(totalDataProcessed), color: '#9c27b0', }, ]; return ( Metrics Overview {statCards.map((card, index) => ( {card.icon} {card.value} {card.label} ))} ); }; export default MetricsOverview;