import PopupWindow from "@/widgets/popupwindow"; import { bind, register, Variable } from "astal"; import { Astal, Gtk, Widget } from "astal/gtk3"; type Mode = "apps" | "files" | "math" | "windows"; interface ModeContent { updateContent(search: string): void; handleActivate(search: string): void; } @register() class Apps extends Widget.Box implements ModeContent { constructor() { super({ name: "apps" }); } updateContent(search: string): void { throw new Error("Method not implemented."); } handleActivate(search: string): void { throw new Error("Method not implemented."); } } @register() class Files extends Widget.Box implements ModeContent { constructor() { super({ name: "files" }); } updateContent(search: string): void { throw new Error("Method not implemented."); } handleActivate(search: string): void { throw new Error("Method not implemented."); } } @register() class Math extends Widget.Box implements ModeContent { constructor() { super({ name: "math" }); } updateContent(search: string): void { throw new Error("Method not implemented."); } handleActivate(search: string): void { throw new Error("Method not implemented."); } } @register() class Windows extends Widget.Box implements ModeContent { constructor() { super({ name: "windows" }); } updateContent(search: string): void { throw new Error("Method not implemented."); } handleActivate(search: string): void { throw new Error("Method not implemented."); } } const SearchBar = ({ mode, entry }: { mode: Variable; entry: Widget.Entry }) => ( ); const ModeSwitcher = ({ mode, modes }: { mode: Variable; modes: Mode[] }) => ( {modes.map(m => (