import { UserRole } from "@prisma/client";

type RedirectUser = {
  role?: UserRole | string;
  kitaId?: string | null;
};

export function getPostLoginRedirect(user: RedirectUser) {
  if (user.role === UserRole.SUPERADMIN || user.role === "SUPERADMIN") {
    return "/admin";
  }

  return user.kitaId ? "/dashboard" : "/onboarding";
}
