import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Progress } from "@/components/ui/progress"; import { Cpu, HardDrive, Laptop } from "lucide-react"; import { SystemSpecs } from "@/lib/recommendation"; import { useEffect, useState } from "react"; interface HardwareScanProps { specs: SystemSpecs | null; loading: boolean; } export function HardwareScan({ specs, loading }: HardwareScanProps) { const [progress, setProgress] = useState(0); useEffect(() => { if (loading) { const interval = setInterval(() => { setProgress((prev) => (prev >= 90 ? 90 : prev + 10)); }, 150); return () => clearInterval(interval); } else { setProgress(100); } }, [loading]); if (loading) { return ( Analisando Hardware... Verificando memória e processador para recomendação ideal. ); } if (!specs) return null; const ramGB = (specs.total_memory / (1024 * 1024 * 1024)).toFixed(1); return ( Sistema Detectado {ramGB} GB RAM Total {specs.cpu_count} Núcleos CPU ); }
Verificando memória e processador para recomendação ideal.