mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2025-10-10 21:01:54 +05:30
22 lines
498 B
TypeScript
22 lines
498 B
TypeScript
import { createBinding, For } from "ags";
|
|
import AstalTray from "gi://AstalTray";
|
|
|
|
export const Tray = () => {
|
|
const tray = AstalTray.get_default();
|
|
const items = createBinding(tray, "items");
|
|
|
|
return (
|
|
<box cssClasses={["pill", "tray"]}>
|
|
<For each={items}>{(item) => <Item item={item} />}</For>
|
|
</box>
|
|
);
|
|
};
|
|
|
|
const Item = ({ item }: { item: AstalTray.TrayItem }) => {
|
|
return (
|
|
<menubutton>
|
|
<image gicon={createBinding(item, "gicon")} />
|
|
</menubutton>
|
|
);
|
|
};
|