From d06784958d73159b5e4abafe5114804662114ed7 Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Thu, 9 Jul 2026 22:15:53 -0400 Subject: move ubersicht modules in tree --- .../lib/components/aerospace/opened-apps.jsx | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 users/ryan/modules/simple-bar/simple-bar-source/lib/components/aerospace/opened-apps.jsx (limited to 'users/ryan/modules/simple-bar/simple-bar-source/lib/components/aerospace/opened-apps.jsx') diff --git a/users/ryan/modules/simple-bar/simple-bar-source/lib/components/aerospace/opened-apps.jsx b/users/ryan/modules/simple-bar/simple-bar-source/lib/components/aerospace/opened-apps.jsx new file mode 100755 index 0000000..5b56966 --- /dev/null +++ b/users/ryan/modules/simple-bar/simple-bar-source/lib/components/aerospace/opened-apps.jsx @@ -0,0 +1,33 @@ +import * as Uebersicht from "uebersicht"; +import * as AppIcons from "../../app-icons.js"; +import { SuspenseIcon } from "../icons/icon.jsx"; +import * as Utils from "../../utils.js"; + +const { React } = Uebersicht; + +/** + * OpenedApps component to display icons of opened applications. + * @param {Object} props - The component props. + * @param {Array} props.apps - The list of opened applications. + * @returns {JSX.Element|null} The rendered component or null if no apps are opened. + */ +export default function OpenedApps({ apps }) { + if (!apps.length) return null; + + return apps.map((app, i) => { + const { focused } = app; + const appName = Utils.normalizeAppName(app["app-name"]); + const Icon = AppIcons.apps[appName] || AppIcons.apps.Default; + + // Generate class names for the app icon + const classes = Utils.classNames("space__icon", { + "space__icon--focused": focused, + }); + + return ( + + + + ); + }); +} -- cgit v1.3