import {
  ClipboardList,
  LayoutDashboard,
  MessageSquare,
  Microscope,
  Package,
  Phone,
  Search,
  Zap,
  type LucideIcon,
} from 'lucide-react';

export interface AppNavItem {
  id: string;
  path: string;
  label: string;
  icon: LucideIcon;
  children?: AppNavChildItem[];
}

export interface AppNavChildItem {
  id: string;
  path: string;
  label: string;
  search?: string;
}

export const appNavItems: AppNavItem[] = [
  { id: '/', path: '/', label: '采购总览', icon: LayoutDashboard },
  { id: '/batches', path: '/batches', label: '采购批次', icon: Package },
  { id: '/materials', path: '/materials', label: '采购清单', icon: ClipboardList },
  {
    id: '/standardized',
    path: '/standardized',
    label: 'AI标准化',
    icon: Microscope,
    children: [
      { id: 'standardized-success', path: '/standardized', label: '标准化成功数据' },
      { id: 'standardized-failed', path: '/standardized', label: '标准化失败数据', search: '?tab=failed' },
      { id: 'standardized-tasks', path: '/standardized', label: '标准化任务状态', search: '?tab=tasks' },
    ],
  },
  {
    id: '/search-results',
    path: '/search-results',
    label: '智能搜索',
    icon: Search,
    children: [
      { id: 'search-results-results', path: '/search-results', label: '搜索结果' },
      { id: 'search-results-tasks', path: '/search-results', label: '搜索任务状态', search: '?tab=tasks' },
    ],
  },
  {
    id: '/smart-inquiry',
    path: '/smart-inquiry',
    label: '智能询价',
    icon: Zap,
    children: [
      { id: 'smart-inquiry-config', path: '/smart-inquiry', label: '话术配置' },
      { id: 'smart-inquiry-tasks', path: '/smart-inquiry', label: '询价任务', search: '?tab=tasks' },
    ],
  },
  { id: '/contact-logs', path: '/contact-logs', label: '联系记录', icon: MessageSquare },
  { id: '/merchants', path: '/merchants', label: '商家通讯录', icon: Phone },
];

export const appRouteLabels = Object.fromEntries(
  appNavItems.map(({ path, label }) => [path, label]),
) as Record<string, string>;