fix(toast): add fallback if icon doesn't start with bx-

This commit is contained in:
Elian Doran 2025-12-06 23:49:56 +02:00
parent 888ff33be1
commit eb8f2021cb
No known key found for this signature in database

View File

@ -26,7 +26,7 @@ function Toast({ id, title, autohide, delay, progress, message, icon }: ToastOpt
}, [ autohide, id, delay ]);
const closeButton = <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close" />;
const toastIcon = <Icon icon={icon} />;
const toastIcon = <Icon icon={icon.startsWith("bx ") ? icon : `bx bx-${icon}`} />;
return (
<div