export interface AdminBreadcrumbItem {
  label: string;
  to?: string;
}

/** 子页面顶栏面包屑（一级菜单 + 当前子页） */
export function resolveAdminBreadcrumb(
  path: string,
  t: (key: string) => string,
): AdminBreadcrumbItem[] | null {
  if (/^\/settlement\/[^/]+/.test(path)) {
    return [
      { label: t('nav.matches'), to: '/matches' },
      { label: t('breadcrumb.settlement') },
    ];
  }
  if (/^\/matches\/[^/]+\/edit/.test(path)) {
    return [
      { label: t('nav.matches'), to: '/matches' },
      { label: t('breadcrumb.match_edit') },
    ];
  }
  if (/^\/matches\/[^/]+\/markets/.test(path)) {
    return [
      { label: t('nav.matches'), to: '/matches' },
      { label: t('breadcrumb.match_markets') },
    ];
  }
  if (path === '/matches/outrights') {
    return [
      { label: t('nav.matches'), to: '/matches' },
      { label: t('nav.matches.outrights') },
    ];
  }
  if (/^\/outrights\/[^/]+\/edit/.test(path)) {
    return [
      { label: t('nav.matches'), to: '/matches' },
      { label: t('nav.matches.outrights'), to: '/matches/outrights' },
    ];
  }
  return null;
}
