/* Canonical player-profile link builder (Session 42). Used everywhere a
   player name should be tappable. CommonJS so it's testable + importable. */

function playerHref(name, sport) {
  const n = encodeURIComponent(String(name == null ? '' : name).trim());
  const sp = String(sport || 'nba').toLowerCase();
  return `/player/${n}?sport=${encodeURIComponent(sp)}`;
}

module.exports = { playerHref };
