// 农机档案
import { MachineryArchive } from '../machinery/MachineryArchive';
import { MachineryClassification } from '../machinery/archive/MachineryClassification';
import { MachineryQRCode } from '../machinery/archive/MachineryQRCode';

// 驾驶员档案
import { DriverInfo } from '../machinery/driver/DriverInfo';
import { DriverTaskManagement } from '../machinery/driver/DriverTaskManagement';

// 农机负载管理
import { LoadDevice } from '../machinery/load/LoadDevice';
import { LoadType } from '../machinery/load/LoadType';
import { LoadParameter } from '../machinery/load/LoadParameter';
import { LoadDeviceLibrary } from '../machinery/load/LoadDeviceLibrary';

// 设备实时监控与定位
import { RealtimeLocation } from '../machinery/monitoring/RealtimeLocation';
import { WorkStatus } from '../machinery/monitoring/WorkStatus';
import { OperationData } from '../machinery/monitoring/OperationData';

// 远程诊断与故障预警
import { FaultDiagnosis } from '../machinery/FaultDiagnosis';

// 精准作业管理与支持
import { OperationRecord } from '../machinery/operation/OperationRecord';
import { RoutePlanning } from '../machinery/operation/RoutePlanning';
import { PlanDispatch } from '../machinery/operation/PlanDispatch';
import { Cockpit } from '../machinery/operation/Cockpit';

// 数据管理与分析报告
import { OperationAnalysis } from '../machinery/data/OperationAnalysis';
import { HistoryComparison } from '../machinery/data/HistoryComparison';

// 农机管理与调度
import { TaskAssignment } from '../machinery/scheduling/TaskAssignment';
import { RealtimeDispatch } from '../machinery/scheduling/RealtimeDispatch';
import { TrackPlayback } from '../machinery/scheduling/TrackPlayback';

// 安全与安防
import { GeoFence } from '../machinery/security/GeoFence';

interface MachineryManagementProps {
  activePath: string;
}

export function MachineryManagement({ activePath }: MachineryManagementProps) {
  const renderContent = () => {
    switch (activePath) {
      // 农机档案
      case '/machinery/archive/entry':
        return <MachineryArchive />;
      case '/machinery/archive/classification':
        return <MachineryClassification />;
      case '/machinery/archive/qrcode':
        return <MachineryQRCode />;
      
      // 驾驶员档案
      case '/machinery/driver/info':
        return <DriverInfo />;
      case '/machinery/driver/task':
        return <DriverTaskManagement drivers={[]} />;
      
      // 农机负载管理
      case '/machinery/load/type':
        return <LoadType />;
      case '/machinery/load/parameter':
        return <LoadParameter />;
      case '/machinery/load/library':
        return <LoadDeviceLibrary />;
      case '/machinery/load/device':
        return <LoadDevice />;
      
      // 设备实时监控与定位
      case '/machinery/monitoring/location':
        return <RealtimeLocation />;
      case '/machinery/monitoring/status':
        return <WorkStatus />;
      case '/machinery/monitoring/operation':
        return <OperationData />;
      
      // 远程诊断与故障预警
      case '/machinery/fault/alert-rules':
      case '/machinery/fault/warning':
      case '/machinery/fault/health':
      case '/machinery/fault/parameter':
        return <FaultDiagnosis activePath={activePath} />;
      
      // 精准作业管理与支持
      case '/machinery/operation/record':
        return <OperationRecord />;
      case '/machinery/operation/route':
        return <RoutePlanning />;
      case '/machinery/operation/dispatch':
        return <PlanDispatch />;
      case '/machinery/operation/cockpit':
        return <Cockpit />;
      
      // 数据管理与分析报告
      case '/machinery/data/analysis':
        return <OperationAnalysis />;
      case '/machinery/data/comparison':
        return <HistoryComparison />;
      
      // 农机管理与调度
      case '/machinery/scheduling/assignment':
        return <TaskAssignment />;
      case '/machinery/scheduling/dispatch':
        return <RealtimeDispatch />;
      case '/machinery/scheduling/playback':
        return <TrackPlayback />;
      
      // 安全与安防
      case '/machinery/security/fence':
        return <GeoFence />;
      
      default:
        return <MachineryArchive />;
    }
  };

  return <>{renderContent()}</>;
}
