import type { TranslationPageGroup } from '../hook/use-translation-page-groups';
import type { Translation } from '../types/translation-types';

const PROFILE_MENU_PAGES: Record<string, string> = {
  page_title: 'profile_menu',
  account_setting: 'account_setting',
  notification_setting: 'notification_setting',
  my_organization: 'my_organization',
};

// Resolve using the full page list: the Profile Menu filter hides its destinations.
export function getProfileMenuPage(item: Translation, groups: TranslationPageGroup[]) {
  if (item.module !== 'shared' || item.page !== 'profile_menu') return undefined;
  const page = PROFILE_MENU_PAGES[item.translationKey];
  return page ? groups.find(group => group.module === 'shared' && group.page === page) : undefined;
}
