"use client";

import React from 'react';
import { OCDResult } from './OCDResult';
import { SCL90Result } from './SCL90Result';
import { SDSResult } from './SDSResult';
import { GAD7Result } from './GAD7Result';
import { PHQ9Result } from './PHQ9Result';
import { PSS10Result } from './PSS10Result';
import { DASS21Result } from './DASS21Result';
import { BDI2Result } from './BDI2Result';
import { ISIResult } from './ISIResult';
import { ADHDResult } from './ADHDResult';
import { GDResult } from './GDResult';
import { NPDResult } from './NPDResult';
import { BigFiveResult } from './BigFiveResult';
import { CRTResult } from './CRTResult';
import { OEPSResult } from './OEPSResult';
import { RIASECResult } from './RIASECResult';
import { WHO5Result } from './WHO5Result';
import { SelfEsteemResult } from './SelfEsteemResult';
import { GritResult } from './GritResult';
import { SelfControlResult } from './SelfControlResult';
import { NeedForCognitionResult } from './NeedForCognitionResult';
import { MaximizerResult } from './MaximizerResult';
import { AttachmentResult } from './AttachmentResult';
import { EmpathyResult } from './EmpathyResult';
import { DarkTriadResult } from './DarkTriadResult';
import { HEXACOResult } from './HEXACOResult';
import { FisherResult } from './FisherResult';
import { SchwartzResult } from './SchwartzResult';
import { VIAResult } from './VIAResult';
import { CareerAnchorsResult } from './CareerAnchorsResult';

interface Props {
  questionnaireId: string;
  answers: string[];
}

export function ResultAnalysis({ questionnaireId, answers }: Props) {
  switch (questionnaireId) {
    case 'bigfive':
      return <BigFiveResult answers={answers} version={50} />;
    case 'bigfive-120':
      return <BigFiveResult answers={answers} version={120} />;
    case 'bigfive-300':
      return <BigFiveResult answers={answers} version={300} />;
    case 'oeps':
      return <OEPSResult answers={answers} />;
    case 'crt':
      return <CRTResult answers={answers} />;
    case 'riasec':
      return <RIASECResult answers={answers} />;
    case 'self-esteem':
      return <SelfEsteemResult answers={answers} />;
    case 'grit':
      return <GritResult answers={answers} />;
    case 'self-control':
      return <SelfControlResult answers={answers} />;
    case 'need-for-cognition':
      return <NeedForCognitionResult answers={answers} />;
    case 'maximizer':
      return <MaximizerResult answers={answers} />;
    case 'attachment':
      return <AttachmentResult answers={answers} />;
    case 'empathy':
      return <EmpathyResult answers={answers} />;
    case 'dark-triad':
      return <DarkTriadResult answers={answers} />;
    case 'hexaco':
      return <HEXACOResult answers={answers} />;
    case 'fisher':
      return <FisherResult answers={answers} />;
    case 'schwartz':
      return <SchwartzResult answers={answers} />;
    case 'via':
      return <VIAResult answers={answers} />;
    case 'career-anchors':
      return <CareerAnchorsResult answers={answers} />;
    case 'ocd':
      return <OCDResult answers={answers} />;
    case 'scl90':
      return <SCL90Result answers={answers} />;
    case 'sds':
      return <SDSResult answers={answers} />;
    case 'gad7':
      return <GAD7Result answers={answers} />;
    case 'phq9':
      return <PHQ9Result answers={answers} />;
    case 'pss10':
      return <PSS10Result answers={answers} />;
    case 'dass21':
      return <DASS21Result answers={answers} />;
    case 'who5':
      return <WHO5Result answers={answers} />;
    case 'bdi2':
      return <BDI2Result answers={answers} />;
    case 'isi':
      return <ISIResult answers={answers} />;
    case 'adhd':
      return <ADHDResult answers={answers} />;
    case 'gd':
      return <GDResult answers={answers} />;
    case 'npd':
      return <NPDResult answers={answers} />;
    default:
      return (
        <div className="mt-6 p-6 bg-yellow-50 border border-yellow-200 rounded-lg">
          <div className="text-yellow-800">
            <h3 className="font-semibold mb-2">暂不支持的量表</h3>
            <p className="text-sm">
              抱歉，暂时不支持量表ID为 &quot;{questionnaireId}&quot; 的结果分析。
              请检查量表配置或联系开发人员。
            </p>
          </div>
        </div>
      );
  }
}
