import React from 'react'; import { useSelector } from 'react-redux'; import StyledWrapper from './StyledWrapper'; import { IconCpu, IconDatabase, IconClock, IconServer, IconChartLine } from '@tabler/icons'; const Performance = () => { const { systemResources } = useSelector((state) => state.performance); const formatBytes = (bytes) => { if (bytes === 0) return '0 Bytes'; const k = 1024; const sizes = ['Bytes', 'KB', 'MB', 'GB']; const i = Math.floor(Math.log(bytes) / Math.log(k)); return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; }; const formatUptime = (seconds) => { const hours = Math.floor(seconds / 3600); const minutes = Math.floor((seconds % 3600) / 60); const secs = Math.floor(seconds % 60); if (hours > 0) return `${hours}h ${minutes}m ${secs}s`; if (minutes > 0) return `${minutes}m ${secs}s`; return `${secs}s`; }; const SystemResourceCard = ({ icon: Icon, title, value, subtitle, color = 'default', trend }) => (