export enum SpaToasterSeverityEnum {
    ERROR = 'error',
    INFO = 'info',
    SUCCESS = 'success',
    WARNING = 'warning',
}

export enum SpaToasterAutoCloseSpeedEnum {
    DEFAULT = -1,
    SLOW = -2,
}

export function toasterAutocloseSpeed(autoCloseSpeed: SpaToasterAutoCloseSpeedEnum, messageText: string) {
    switch (autoCloseSpeed) {
        case SpaToasterAutoCloseSpeedEnum.DEFAULT:
            return Math.min(Math.max(messageText.length * 50, 2000), 7000);
        case SpaToasterAutoCloseSpeedEnum.SLOW:
            return Math.min(Math.max(messageText.length * 60, 3000), 10000);
        default:
            return autoCloseSpeed;
    }
}
