export interface RoleDetail {
  id: string;
  nameEn: string;
  nameEs: string;
}

export const ROLES: Record<string, RoleDetail> = {
  admin: { id: 'admin', nameEn: 'Administrator', nameEs: 'Administrador' },
  director: { id: 'director', nameEn: 'Director', nameEs: 'Director' },
  hotel_manager: { id: 'hotel_manager', nameEn: 'Hotel Manager', nameEs: 'Gerente de Hotel' },
  commercial_leader: { id: 'commercial_leader', nameEn: 'Commercial Leader', nameEs: 'Líder Comercial' },
  analyst: { id: 'analyst', nameEn: 'Analyst', nameEs: 'Analista' },
  auditor: { id: 'auditor', nameEn: 'Auditor', nameEs: 'Auditor' },
  collaborator: { id: 'collaborator', nameEn: 'Collaborator', nameEs: 'Colaborador' }
};

export function getRoleLabel(roleId: string, locale: 'en' | 'es' = 'es'): string {
  const role = ROLES[roleId.toLowerCase()];
  if (!role) return roleId;
  return locale === 'en' ? role.nameEn : role.nameEs;
}

export function getRoleBilingualLabel(roleId: string): string {
  const role = ROLES[roleId.toLowerCase()];
  if (!role) return roleId;
  return `${role.nameEs} / ${role.nameEn}`;
}
