/**
 * Icon resolution for Base components. Use semantic names (e.g. "plus", "trash") in views;
 * they are resolved to PrimeIcons classes here. Avoid raw "pi pi-*" in views.
 *
 * Icon names are PrimeIcons (PrimeVue) — no project mapping. See:
 * https://primevue.org/icons/ or PrimeIcons list for valid names (e.g. plus, trash, check, times).
 *
 * @param {string} name - Icon name (e.g. "plus", "trash") or full class string (e.g. "pi pi-plus")
 * @returns {string} PrimeIcons class string, or empty string if no name
 */
export function resolveIcon(name) {
  if (!name || typeof name !== "string") return "";
  if (name.includes(" ")) return name; // already full class string (backward compat)
  return "pi pi-" + name;
}
