import { AssetBasicInfo } from '../asset/AssetBasicInfo';
import { AssetPurchase } from '../asset/AssetPurchase';
import { AssetInventory } from '../asset/AssetInventory';
import { AssetRequisition } from '../asset/AssetRequisition';
import { AssetReturn } from '../asset/AssetReturn';
import { AssetEquipment } from '../asset/AssetEquipment';
import { AssetReport } from '../asset/AssetReport';

interface AssetManagementProps {
  activePath: string;
  onNavigate?: (path: string) => void;
}

export function AssetManagement({ activePath, onNavigate }: AssetManagementProps) {
  const renderContent = () => {
    switch (activePath) {
      // 基础信息管理
      case '/asset/basic/materials':
      case '/asset/basic/tools':
      case '/asset/basic/suppliers':
      case '/asset/basic/customers':
        return <AssetBasicInfo activePath={activePath} />;
      // 采购管理
      case '/asset/purchase/plan':
      case '/asset/purchase/order':
        return <AssetPurchase activePath={activePath} />;
      // 库存管理
      case '/asset/inventory/in':
      case '/asset/inventory/out':
      case '/asset/inventory/check':
      case '/asset/inventory/warning':
      case '/asset/inventory/detail':
      case '/asset/inventory/location':
      case '/asset/inventory/suggest':
        return <AssetInventory activePath={activePath} />;
      // 物资领用
      case '/asset/requisition/apply':
      case '/asset/requisition/approval':
      case '/asset/requisition/checkout':
      case '/asset/requisition/record':
        return <AssetRequisition activePath={activePath} />;
      // 物资归还
      case '/asset/return/register':
      case '/asset/return/process':
      case '/asset/return/settlement':
      case '/asset/return/history':
        return <AssetReturn activePath={activePath} />;
      // 农资农具管理
      case '/asset/equipment/archive':
      case '/asset/equipment/dispatch':
      case '/asset/equipment/maintenance':
      case '/asset/equipment/depreciation':
      case '/asset/equipment/disposal':
        return <AssetEquipment activePath={activePath} onNavigate={onNavigate} />;
      // 可视化报表
      case '/asset/report/overview':
      case '/asset/report/inventory':
      case '/asset/report/consumption':
        return <AssetReport activePath={activePath} />;
      default:
        return <AssetBasicInfo activePath={activePath} />;
    }
  };

  return renderContent();
}
