File Manager

Current Path : /webspace/www.beetasty.be/html/wp-content/plugins/wp-smushit/_src/react/utils/
Upload File :
Current File : //webspace/www.beetasty.be/html/wp-content/plugins/wp-smushit/_src/react/utils/notices.js

export function showSuccessNotice(id, message, dismissible = true) {
	return showNotice(id, message, 'success', dismissible);
}

export function showErrorNotice(id, message, dismissible = true) {
	return showNotice(id, message, 'error', dismissible);
}

export function showInfoNotice(id, message, dismissible = true) {
	return showNotice(id, message, 'info', dismissible);
}

export function showWarningNotice(id, message, dismissible = true) {
	return showNotice(id, message, 'warning', dismissible);
}

export function closeNotice(id) {
	SUI.closeNotice(id);
}

export function showNotice(id, message, type = 'success', dismissible = true) {
	const icons = {
		error: 'warning-alert',
		info: 'info',
		warning: 'warning-alert',
		success: 'check-tick'
	};

	SUI.closeNotice(id);
	SUI.openNotice(id, '<p>' + message + '</p>', {
		type: type,
		icon: icons[type],
		dismiss: {show: dismissible}
	});
}

File Manager Version 1.0, Coded By Lucas
Email: hehe@yahoo.com