import { useState } from 'react'; import { glasgowScale, getGlasgowInterpretation } from '@/data/calculators'; import Badge from '@/components/shared/Badge'; import { cn } from '@/lib/utils'; const GlasgowCalculator = () => { const [scores, setScores] = useState>({ 'Apertura Ocular': 4, 'Respuesta Verbal': 5, 'Respuesta Motora': 6, }); const totalScore = Object.values(scores).reduce((sum, score) => sum + score, 0); const interpretation = getGlasgowInterpretation(totalScore); const handleScoreChange = (category: string, value: number) => { setScores((prev) => ({ ...prev, [category]: value })); }; return (

🧠 Escala de Glasgow (GCS)

{glasgowScale.map((category) => (

{category.name}

{scores[category.name]}
{category.options.map((option) => ( ))}
))}

Puntuación Total

{totalScore}

{interpretation.severity}

Rango: 3 (mínimo) - 15 (máximo)

≤8: Grave (IOT) | 9-12: Moderado | 13-15: Leve

); }; export default GlasgowCalculator;