Spaces:
Build error
Build error
File size: 2,870 Bytes
2373915 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | import { useState, useEffect } from 'react'
import { motion } from 'framer-motion'
import {
FaCode, FaDatabase, FaCloud, FaShieldAlt, FaChartLine,
FaProjectDiagram, FaBug, FaRocket, FaUsers, FaClock,
FaCheckCircle, FaExclamationTriangle, FaInfoCircle,
FaArrowUp, FaArrowDown, FaMinus, FaTrendingUp, FaTrendingDown,
FaFire, FaBolt, FaStar, FaHeart, FaThumbsUp, FaEye,
FaDownload, FaUpload, FaSync, FaCog, FaBell, FaEnvelope,
FaCalendar, FaMapMarkerAlt, FaGlobe, FaLink, FaShare,
FaBookmark, FaFlag, FaTag, FaComments, FaMessage,
FaRobot, FaBrain, FaMicrochip, FaMemory, FaServer,
FaNetworkWired, FaWifi, FaEthernet, FaUsb, FaBluetooth,
FaSatellite, FaSignal, FaRadio, FaBroadcastTower, FaPodcast
} from 'react-icons/fa'
export default function Dashboard({ language, theme }) {
const [stats, setStats] = useState({
projects: 12,
activeUsers: 245,
codeLines: 125000,
bugsFixed: 89,
deployments: 34,
uptime: 99.9
})
const [activities, setActivities] = useState([
{ id: 1, type: 'deploy', message: 'Deployed to production', time: '2 min ago', icon: FaRocket },
{ id: 2, type: 'bug', message: 'Fixed critical bug in auth module', time: '15 min ago', icon: FaBug },
{ id: 3, type: 'code', message: 'Pushed 245 lines of code', time: '1 hour ago', icon: FaCode },
{ id: 4, type: 'merge', message: 'Merged feature branch', time: '2 hours ago', icon: FaProjectDiagram },
{ id: 5, type: 'test', message: 'All tests passed', time: '3 hours ago', icon: FaCheckCircle }
])
const [performance, setPerformance] = useState({
cpu: 45,
memory: 62,
disk: 38,
network: 71
})
useEffect(() => {
// Simulate real-time updates
const interval = setInterval(() => {
setPerformance(prev => ({
cpu: Math.max(0, Math.min(100, prev.cpu + (Math.random() - 0.5) * 10)),
memory: Math.max(0, Math.min(100, prev.memory + (Math.random() - 0.5) * 8)),
disk: Math.max(0, Math.min(100, prev.disk + (Math.random() - 0.5) * 5)),
network: Math.max(0, Math.min(100, prev.network + (Math.random() - 0.5) * 15))
}))
}, 3000)
return () => clearInterval(interval)
}, [])
const getStatIcon = (key) => {
const icons = {
projects: FaProjectDiagram,
activeUsers: FaUsers,
codeLines: FaCode,
bugsFixed: FaBug,
deployments: FaRocket,
uptime: FaCheckCircle
}
return icons[key] || FaChartLine
}
const getStatColor = (key) => {
const colors = {
projects: 'text-blue-400',
activeUsers: 'text-green-400',
codeLines: 'text-purple-400',
bugsFixed: 'text-red-400',
deployments: 'text-yellow-400',
uptime: 'text-emerald-400'
}
return colors[key] || 'text-gray-400'
}
const getActivityIcon = (type) => {
const icons = {
deploy: FaRocket,
bug: Fa |