#!/bin/bash

echo "🔍 检查页面组件的导入问题"
echo "================================"

check_imports() {
  local file=$1
  echo ""
  echo "检查: $file"
  
  # 检查是否有未使用 @ 别名的相对路径
  if grep -n "from '\.\." "$file" | head -5; then
    echo "⚠️  发现相对路径导入（可能导致问题）"
  else
    echo "✓ 导入路径正确"
  fi
  
  # 检查是否有 react-i18next
  if grep -q "react-i18next" "$file"; then
    echo "⚠️  使用了 react-i18next（Umi 使用内置国际化）"
  fi
}

# 检查所有新页面
check_imports "src/pages/Vault/Trade/index.tsx"
check_imports "src/pages/Vault/USDC/index.tsx"
check_imports "src/pages/LP/LPPanelNew.tsx"
check_imports "src/pages/Statistics/Holders/index.tsx"
check_imports "src/pages/Admin/Factory/index.tsx"
check_imports "src/pages/Admin/Lending/index.tsx"
check_imports "src/pages/Lending/User/index.tsx"

echo ""
echo "================================"
echo "✅ 检查完成"
