// 地块管理路由组件 - 2024-10-18 更新
import { FieldEntryMaintenance } from '../field/FieldEntryMaintenance';
import { FieldClassification } from '../field/FieldClassification';
import { FieldStatistics } from '../field/FieldStatistics';
import { FieldGISMap } from '../field/FieldGISMap';
import { FieldDrawEdit } from '../field/FieldDrawEdit';
import { FieldSpatialQuery } from '../field/FieldSpatialQuery';
import { FieldSatellite } from '../field/FieldSatellite';
import { SoilBaseData } from '../field/SoilBaseData';
import { LayerSamplingAnalysis } from '../field/LayerSamplingAnalysis';
import { SoilQualityEvaluation } from '../field/SoilQualityEvaluation';
import { WeatherMonitoring } from '../field/WeatherMonitoring';
import { EnvironmentMonitoring } from '../field/EnvironmentMonitoring';
import { FieldSuitabilityEvaluation } from '../field/FieldSuitabilityEvaluation';
import { FieldComparison } from '../field/FieldComparison';
import { FieldRiskWarning } from '../field/FieldRiskWarning';

interface FieldManagementProps {
  activePath: string;
}

export function FieldManagement({ activePath }: FieldManagementProps) {
  const renderContent = () => {
    switch (activePath) {
      // 地块档案管理
      case '/field/archive/entry':
        return <FieldEntryMaintenance />;
      case '/field/archive/classification':
        return <FieldClassification />;
      case '/field/archive/statistics':
        return <FieldStatistics />;
      // 地块数字化与地图管理
      case '/field/map/gis':
        return <FieldGISMap />;
      case '/field/map/draw':
        return <FieldDrawEdit />;
      case '/field/map/spatial-query':
        return <FieldSpatialQuery />;
      case '/field/map/satellite':
        return <FieldSatellite />;
      // 空间分析与决策支持
      case '/field/analysis/soil-data':
        return <SoilBaseData />;
      case '/field/analysis/layer-sampling':
        return <LayerSamplingAnalysis />;
      case '/field/analysis/soil-quality':
        return <SoilQualityEvaluation />;
      // 地块环境监测
      case '/field/monitoring/weather':
        return <WeatherMonitoring />;
      case '/field/monitoring/environment':
        return <EnvironmentMonitoring />;
      // 地块适宜性评价
      case '/field/suitability/comprehensive':
      case '/field/suitability/batch':
      case '/field/suitability/crop':
      case '/field/suitability/weight':
        return <FieldSuitabilityEvaluation activePath={activePath} />;
      // 地块对比分析
      case '/field/comparison/indicator':
      case '/field/comparison/chart':
      case '/field/comparison/report':
        return <FieldComparison activePath={activePath} />;
      // 地块风险预警
      case '/field/risk/monitoring':
      case '/field/risk/push':
      case '/field/risk/disposal':
        return <FieldRiskWarning activePath={activePath} />;
      default:
        return <FieldEntryMaintenance />;
    }
  };

  return renderContent();
}
