import { Gdk, Gtk } from "astal/gtk4"; import GLib from "gi://GLib?version=2.0"; import Rsvg from "gi://Rsvg?version=2.0"; interface SvgProps { color?: string; path: string; rotation?: number; size?: number; } export function Svg({ color = "#cac9c9", path, rotation = 0, size = 24, }: SvgProps) { const svgString = `${path}`; const bytes = new GLib.Bytes(new TextEncoder().encode(svgString)); const texture = Gdk.Texture.new_from_bytes(bytes); return Gtk.Image.new_from_paintable(texture); }