import { BuffType } from '../game/types';
import type { Translations } from '../i18n/types';

/** Icons and colors for buff UI (labels/descriptions come from i18n like HeroPanel). */
export const BUFF_VISUAL: Record<BuffType, { icon: string; color: string }> = {
  [BuffType.Rush]: { icon: '\u26A1', color: '#44aaff' },
  [BuffType.Rage]: { icon: '\u2694\uFE0F', color: '#ff4444' },
  [BuffType.Shield]: { icon: '\uD83D\uDEE1\uFE0F', color: '#aaaaff' },
  [BuffType.Luck]: { icon: '\uD83C\uDF40', color: '#44ff44' },
  [BuffType.Resurrection]: { icon: '\uD83D\uDD2E', color: '#ffaa44' },
  [BuffType.Heal]: { icon: '\u2764\uFE0F', color: '#ff6699' },
  [BuffType.PowerPotion]: { icon: '\uD83E\uDDEA', color: '#dd44ff' },
  [BuffType.WarCry]: { icon: '\uD83D\uDCE3', color: '#ffcc00' },
};

export function buffUiStrings(tr: Translations, type: BuffType): { label: string; desc: string } {
  const keys: Record<BuffType, [keyof Translations, keyof Translations]> = {
    [BuffType.Rush]: ['buffRush', 'buffRushDesc'],
    [BuffType.Rage]: ['buffRage', 'buffRageDesc'],
    [BuffType.Shield]: ['buffShield', 'buffShieldDesc'],
    [BuffType.Luck]: ['buffLuck', 'buffLuckDesc'],
    [BuffType.Resurrection]: ['buffResurrection', 'buffResurrectionDesc'],
    [BuffType.Heal]: ['buffHeal', 'buffHealDesc'],
    [BuffType.PowerPotion]: ['buffPowerPotion', 'buffPowerPotionDesc'],
    [BuffType.WarCry]: ['buffWarCry', 'buffWarCryDesc'],
  };
  const [lk, dk] = keys[type];
  return { label: tr[lk], desc: tr[dk] };
}
