import {slugifyTitre} from './stageHref';

/**
 * URL d'une fiche artiste solo : /{locale}/personne/{id}/{nom-encodé} (spec : /personne/2025/Sylvain+BAROU),
 * servie par la page /artistes/{id} grâce à une réécriture Next. Sans nom connu, l'URL reste valable.
 */
export function artisteHref(locale: string, aenId: number | string, nom?: string | null): string {
  const base = `/${locale}/personne/${aenId}`;
  return nom?.trim() ? `${base}/${slugifyTitre(nom)}` : base;
}
