import { useState } from "react"; import { PresetPicker, PRESETS } from "./PresetPicker"; import { openWorkspace, applyPreset } from "./socketBridge"; export function Wizard({ onDone, onCancel }: { onDone: (workspaceId: string) => void; onCancel: () => void }) { const [path, setPath] = useState("."); const [preset, setPreset] = useState("2x2"); const [agents, setAgents] = useState([]); const slots = PRESETS.find((p) => p.id === preset)?.slots ?? 1; const agentChoices = ["shell", "claude", "codex", "gemini"]; async function create() { const ws = await openWorkspace(path); const slotSpecs = Array.from({ length: slots }, (_, i) => { const a = agents[i] ?? "shell"; return a === "shell" ? {} : { command: a }; }); await applyPreset(ws, preset, slotSpecs); onDone(ws); } return (
New workspace
setPath(e.target.value)} style={{ width: "100%", margin: "6px 0 16px", padding: 8, background: "#0A0D12", color: "#E6EDF3", border: "1px solid #323C49", borderRadius: 8 }} />
{Array.from({ length: slots }, (_, i) => ( ))}
); }