[195b] Objekteinstellungen: gemischte Werte und Setzen für alle bei Decke, Dach, Öffnung, Höhen; Öffnungs-Editor als Abschnitt statt Dialog

This commit is contained in:
Claude committed 2026-11-12 03:43:10 +00:00
1 parent c5118d66db
commit df950694ee
28 files changed
+479 -148

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
// [195b] Gemeinsame Werte bei Mehrfachauswahl gleicher Art für die Abschnitte der Objekt-Info: `null` bei einem
// einzelnen Element, sonst das Ergebnis der Abfrage aus `state/mixedValues.ts` (je Wert gleich oder „gemischt").
import { useMemo } from "react";
import type { Project } from "../../model/types";
import { useStore } from "../../state/appStore";
import type { Selection } from "../../state/selection";
export function useMulti<T>(kind: "walls" | "ceilings" | "roofs" | "openings", compute: (p: Project, sel: Selection) => T): T | null {
const project = useStore((s) => s.project);
const selection = useStore((s) => s.selection);
// `compute` ist je Aufrufstelle eine Modul-Funktion (stabil).
return useMemo(() => (selection[kind].length > 1 ? compute(project, selection) : null), [project, selection, kind, compute]);
}