support for image displays

This commit is contained in:
SrGooglo 2025-02-05 02:43:08 +00:00
parent 4d0657c0df
commit 1cd6429666

View File

@ -18,6 +18,10 @@ class NotificationUI {
key: notification.key ?? Date.now(),
}
if (typeof notification.message === "string") {
notification.description = notification.message
}
if (notification.title) {
switch (typeof notification.title) {
case "function": {
@ -68,6 +72,12 @@ class NotificationUI {
notfObj.icon = React.isValidElement(notification.icon) ? notification.icon : (createIconRender(notification.icon) ?? <Icons.FiBell />)
}
if (notification.image) {
notfObj.description = <>
<img src={notification.image} alt="notification-image" style={{ width: "100%" }} />
</>
}
if (Array.isArray(notification.actions)) {
notfObj.btn = (
<Space>