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

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