diff --git a/src/components/NotesApp.tsx b/src/components/NotesApp.tsx index 93a2183..3b3415e 100644 --- a/src/components/NotesApp.tsx +++ b/src/components/NotesApp.tsx @@ -1,4 +1,5 @@ import { useCallback, useEffect, useMemo, useState } from "react"; +import { Tags } from "lucide-react"; import { formatTreeTagDisplay } from "@/lib/treeTagDisplay"; import type { Snippet } from "@/types/snippet"; import type { TagTreeNode } from "@/types/tagTree"; @@ -149,8 +150,20 @@ export function NotesApp() {
- -
+ + + +
+ {loading ? ( +
+ + Lade Tag-Baum … +
+ ) : flatOrdered.length === 0 ? ( +
+

+ Noch keine Knoten. Lege den ersten an — er erscheint in der Vorschau und in der Tag-Suche. +

+
- )) - )} + ) : ( + + )} +
-
-

{editingId == null ? "Neuer Knoten" : `Knoten #${editingId} bearbeiten`}

-
- - setName(e.target.value)} className="font-mono text-sm" autoComplete="off" /> -
-
- - setLabelPrefix(e.target.value)} - placeholder="Projekt:" - className="font-mono text-sm" - autoComplete="off" - /> -

- Vorschau:{" "} - - {name.trim() ? formatTreeTagDisplay(name.trim(), labelPrefix) : "—"} - + {/* Formular */} +

+
+

+ {editingId == null ? "Knoten anlegen" : "Knoten bearbeiten"}

+ {editingId != null ? ( +

ID {editingId}

+ ) : null}
-
- - -
-
- -
- setColor(e.target.value)} - placeholder="#3b82f6" - className="font-mono text-sm" - autoComplete="off" - /> - setColor(e.target.value)} - aria-label="Farbe wählen" - /> + +
+ {error ? ( +

+ {error} +

+ ) : null} + +
+
+ + setName(e.target.value)} + className="font-mono text-sm" + autoComplete="off" + placeholder="sp-migrator" + /> +
+ +
+ + setLabelPrefix(e.target.value)} + placeholder="Projekt:" + className="font-mono text-sm" + autoComplete="off" + /> +
+ Vorschau + {previewLabel ?? "—"} +
+
+ +
+ + +
+ +
+ +
+ setColor(e.target.value)} + placeholder="#3b82f6" + className="min-w-0 flex-1 font-mono text-sm" + autoComplete="off" + /> + setColor(e.target.value)} + aria-label="Farbe wählen" + /> +
+
- - -
- -