import type { IngredientNutritionItem } from '@/types/ingredient-catalog.types';

export function ingredientDisplayName(
  item: Pick<IngredientNutritionItem, 'name' | 'namePl'>,
  language: string,
): string {
  if (language.startsWith('pl') && item.namePl) {
    return item.namePl;
  }
  return item.name;
}
