import {User} from "@/interfaces/user";
import moment from "moment";

export const preventNavigation = (navDisabled: boolean, focusMode: boolean): boolean => {
	if (navDisabled) return true;
	if (focusMode) return true;
	return false;
};

export const shouldRedirectHome = (user: User) => {
	if (user.status === "disabled") return true;
	if (user.isFirstLogin && user.type === "student") return true;
	if (!user.demographicInformation) return true;
	if (user.subscriptionExpirationDate && moment(new Date()).isAfter(user.subscriptionExpirationDate)) return true;

	return false;
};
