From 8f32fd58cafe677c07d9ed9fff84f6e255156d37 Mon Sep 17 00:00:00 2001
From: darkuss <darkussdelta@gmail.com>
Date: Sat, 22 Aug 2026 01:58:37 +0200
Subject: holy shit i'm finally done

---
 src/taskbar/index.tsx | 44 +++++++++++++++++++++++++++++---------------
 1 file changed, 29 insertions(+), 15 deletions(-)

(limited to 'src/taskbar/index.tsx')

diff --git a/src/taskbar/index.tsx b/src/taskbar/index.tsx
index 34377c2..3752e52 100644
--- a/src/taskbar/index.tsx
+++ b/src/taskbar/index.tsx
@@ -1,25 +1,39 @@
 import { StartButton } from "./start"
 import { Time } from "./time"
+import { Task, taskManager } from "$/desktop"
+import { useCallback } from "preact/hooks"
+import { useLiveSignal } from "@preact/signals/utils";
+
+function TaskButton({ task }: TaskButton.Props) {
+    const source = useLiveSignal(task.source);
+    const title = useLiveSignal(task.title);
+
+    const handleClick = useCallback(() => {
+        task.window.minimized.value = !task.window.minimized.value;
+        taskManager.focusWindow(task)
+    }, [])
+
+    return <li>
+        <button onClick={handleClick}>
+            <img src={`/assets/${source.value.value.type}.png`} />
+            <div>{title.value.value ?? "[404 Title Not Found]"}</div>
+        </button>
+    </li>
+}
+
+namespace TaskButton {
+    export type Props = {
+        task: Task
+    }
+}
 
 export function Taskbar() {
+    const sortedTasks = [...taskManager.tasks.value.value].sort((a, b) => a.id - b.id);
+
     return <nav>
         <StartButton />
         <ul>
-            <li>
-                <button>
-                    README.txt
-                </button>
-            </li>
-            <li>
-                <button>
-                KEYGEn
-                </button>
-            </li>
-            <li>
-                <button>
-                Chat
-                </button>
-            </li>
+            { sortedTasks.map(task => <TaskButton task={task}/>)}
         </ul>
         <Time />
         <div id="netpunk_descender"></div>
-- 
cgit v1.2.3

