import { RoleEnum } from "@/constants/roleEnum";

export const getInitials = (firstName: string, lastName: string): string => {
  if (!firstName && !lastName) return "";

  const firstInitial = firstName?.trim().charAt(0).toUpperCase() ?? "";
  const lastInitial = lastName?.trim().charAt(0).toUpperCase() ?? "";

  return `${firstInitial}${lastInitial}`;
};

export const getRoleLabel = (role: RoleEnum) => {
  switch (role) {
    case RoleEnum.MANAGER:
      return "Manager";
    case RoleEnum.ADMIN:
      return "Admin";
    case RoleEnum.USER:
      return "User";
    default:
      return "Unknown";
  }
};
