'use client';

import { SpatialAnalysisState, SpatialAnalysisAction } from './spatialAnalysisReducer';
import BatchEvaluationPanel from './BatchEvaluationPanel';
import AnalysisResults from './AnalysisResults';
import FactorWeights from './FactorWeights';
import EvaluationModel from './EvaluationModel';

interface SpatialAnalysisContentProps {
  state: SpatialAnalysisState;
  dispatch: React.Dispatch<SpatialAnalysisAction>;
}

export default function SpatialAnalysisContent({ state, dispatch }: SpatialAnalysisContentProps) {
  return (
    <div className="space-y-6">
      {/* 标题区域 */}
      <div>
        <h2 className="text-xl text-green-800 dark:text-green-200">自动化空间分析</h2>
        <p className="text-sm text-muted-foreground mt-1">
          多因子评价模型，批量生成地块适宜性指数并更新到数据库
        </p>
      </div>

      {/* 权重配置面板 */}
      <FactorWeights state={state} dispatch={dispatch} />

      {/* 评价模型配置 */}
      <EvaluationModel state={state} dispatch={dispatch} />

      {/* 批量评价面板 */}
      <BatchEvaluationPanel state={state} dispatch={dispatch} />

      {/* 分析结果记录 */}
      {state.analysisResults.length > 0 && (
        <AnalysisResults state={state} dispatch={dispatch} />
      )}
    </div>
  );
}