mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2025-10-10 04:41:55 +05:30
22 lines
622 B
TypeScript
22 lines
622 B
TypeScript
import { Gtk } from "astal/gtk4";
|
|
import Notifd from "gi://AstalNotifd";
|
|
import { fileExists, isIcon } from "./notifd";
|
|
|
|
export const Icon = (notification: Notifd.Notification) => {
|
|
const icon =
|
|
notification.image || notification.appIcon || notification.desktopEntry;
|
|
if (!icon) return null;
|
|
if (fileExists(icon))
|
|
return (
|
|
<box hexpand={false} vexpand={false} valign={Gtk.Align.CENTER}>
|
|
<image file={icon} />
|
|
</box>
|
|
);
|
|
else if (isIcon(icon))
|
|
return (
|
|
<box hexpand={false} vexpand={false} valign={Gtk.Align.CENTER}>
|
|
<image iconName={icon} />
|
|
</box>
|
|
);
|
|
};
|