added stuff

This commit is contained in:
Charlie Root 2024-04-09 23:11:33 +02:00
commit 9d0ebdfbd0
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,36 @@
import { Widget } from "../imports.js";
import { queryExact } from "./global.js";
const { Box, Icon, Label, Button } = Widget;
/**
* Builds a desktop item with a specific name and label.
* It uses the `queryExact` function to find the exact application based on its name.
* Then, it creates a button widget with the application's icon and label.
* When the button is clicked, it launches the application.
*
* @function buildDesktopItem
* @param {string} name - The name of the application.
* @param {string} label - The label of the desktop item.
* @returns {Object} The desktop item widget.
*/
export const buildDesktopItem = (name, label) => {
const app = queryExact(name);
return Button({
className: "desktopIcon",
cursor: "pointer",
onClicked: () => app.launch(),
child: Box({
vertical: true,
children: [
Icon({
icon: app.iconName,
size: 48,
}),
Label({
className: "desktopIconLabel",
label,
}),
],
}),
});
};