'use client'; import React from 'react'; import { useScopedI18n } from '@/locales/client'; import { calculateSCL90Results } from '../../test/private/SCL90Calculator'; interface SCL90ResultProps { answers: string[]; } export function SCL90Result({ answers }: SCL90ResultProps) { const t = useScopedI18n('components.scl90Result'); const tCommon = useScopedI18n('common'); // Convert answer format to the format required by calculator const answersMap: { [key: number]: string } = {}; answers.forEach((answer, index) => { answersMap[index + 1] = answer; }); const results = calculateSCL90Results({ answers: answersMap, questions: [] }); const factorNames = { somatization: t('factors.somatization'), obsessive: t('factors.obsessive'), interpersonal: t('factors.interpersonal'), depression: t('factors.depression'), anxiety: t('factors.anxiety'), hostility: t('factors.hostility'), phobic: t('factors.phobic'), paranoid: t('factors.paranoid'), psychotic: t('factors.psychotic'), other: t('factors.other') }; const severityNames = { normal: tCommon('severity.normal'), mild: tCommon('severity.mild'), moderate: tCommon('severity.moderate'), severe: tCommon('severity.severe') }; const getSeverityColor = (severity: string) => { switch (severity) { case "normal": return "text-green-600"; case "mild": return "text-yellow-600"; case "moderate": return "text-orange-600"; case "severe": return "text-red-600"; default: return "text-gray-600"; } }; const getFactorSeverity = (score: number) => { if (score >= 3) return "severe"; if (score >= 2) return "moderate"; if (score >= 1.5) return "mild"; return "normal"; }; return (