// rooms.jsx — richer Layout-Editor for rooms
const ROOM_LIST = [
{ id: "bc2-1103", name: "BC2 1.103", sub: "20 Sitze · 4 Tische", building: "Campus Belval", capacity: 20, used: "Funktionale Programmierung · SS 2026" },
{ id: "bc2-1207", name: "BC2 1.207", sub: "16 Sitze · 4 Tische", building: "Campus Belval", capacity: 16, used: "Datenbanken · SS 2026" },
{ id: "lib-004", name: "Lib 0.04", sub: "12 Sitze · 3 Tische", building: "Bibliothek", capacity: 12, used: "—" },
{ id: "kirch-12", name: "Kirchberg E12", sub: "24 Sitze · 6 Tische", building: "Kirchberg", capacity: 24, used: "Algorithmen · WS 2025" },
];
const RoomsScreenV2 = () => {
const [activeRoom, setActiveRoom] = React.useState("bc2-1103");
const [activeTool, setActiveTool] = React.useState("seat");
const [selectedEl, setSelectedEl] = React.useState({ kind: "seat", id: "T2-3", x: 540, y: 194, table: "T2" });
const tools = [
{ id: "select", label: "Auswählen", icon: "↖" },
{ id: "seat", label: "Sitz", icon: "○" },
{ id: "table", label: "Tisch", icon: "▭" },
{ id: "door", label: "Tür", icon: "⌐" },
{ id: "window", label: "Fenster", icon: "‖" },
{ id: "gap", label: "Lücke", icon: "·" },
];
const room = ROOM_LIST.find((r) => r.id === activeRoom);
return (
Räume · Layout-Editor
{room.name} · {room.building}
Räume sind kursunabhängig — einmal anlegen, mehrere Semester nutzen. Aktuell: {room.used}
{/* LEFT: Rooms list */}
{ROOM_LIST.map((r) => (
))}
{/* CENTER: Toolbar + canvas */}
{/* Toolbar */}
{tools.map((t) => (
))}
78%
·
Raster: 24px
{/* Canvas */}
{/* Rulers */}
{[0, 100, 200, 300, 400, 500, 600, 700].map((n) => (
{n}
))}
{[0, 100, 200, 300, 400].map((n) => (
{n}
))}
{/* Selection ring on T2-3 */}
{/* drag handles */}
{[[0,-1],[1,0],[0,1],[-1,0]].map(([dx,dy], i) => (
))}
{/* Marginalia */}
Sitz aus Palette ziehen
oder Doppelklick →
Wand mit Snap-Raster
{/* Bottom status bar */}
20 Elemente
·
20 Sitze · 4 Tische · 1 Tür · 1 Fenster · 1 Beamer
Auto-gespeichert · 11:42
{/* RIGHT: Properties + layers */}
Auswahl
Sitz {selectedEl.id}
gehört zu Tisch {selectedEl.table}
Aktionen
{[
{ kind: "wand", label: "Wände" },
{ kind: "tisch", label: "Tisch T1 + 5 Sitze", count: 6 },
{ kind: "tisch", label: "Tisch T2 + 5 Sitze", count: 6, sel: true },
{ kind: "tisch", label: "Tisch T3 + 5 Sitze", count: 6 },
{ kind: "tisch", label: "Tisch T4 + 5 Sitze", count: 6 },
{ kind: "elem", label: "Pult / Tutor:in" },
{ kind: "elem", label: "Beamer" },
{ kind: "elem", label: "Tür" },
{ kind: "elem", label: "Fenster Nord" },
].map((l, i) => (
{l.kind === "wand" ? "▢" : l.kind === "tisch" ? "▤" : "·"}
{l.label}
{l.count && {l.count}}
))}
);
};
const FieldV2 = ({ label, value, mono, suffix }) => (
);
// keyframe for selection spin
if (typeof document !== "undefined" && !document.getElementById("rooms-anim")) {
const s = document.createElement("style");
s.id = "rooms-anim";
s.textContent = "@keyframes spin { to { transform: rotate(360deg); } }";
document.head.appendChild(s);
}
Object.assign(window, { RoomsScreenV2 });