enh: 'notification' event type

This commit is contained in:
Timothy Jaeryang Baek 2025-01-22 09:38:44 -08:00
parent a1e4e7c007
commit ed7db1dd41

View File

@ -321,6 +321,19 @@
eventConfirmationMessage = data.message;
eventConfirmationInputPlaceholder = data.placeholder;
eventConfirmationInputValue = data?.value ?? '';
} else if (type === 'notification') {
const toastType = data?.type ?? 'info';
const toastContent = data?.content ?? '';
if (toastType === 'success') {
toast.success(toastContent);
} else if (toastType === 'error') {
toast.error(toastContent);
} else if (toastType === 'warning') {
toast.warning(toastContent);
} else {
toast.info(toastContent);
}
} else {
console.log('Unknown message type', data);
}