import React, { useState, useEffect } from "react"; import type { Phase } from "../types"; interface NewSessionModalProps { onConfirm: (phase: Phase) => void; onCancel: () => void; } const phaseOptions: { phase: Phase; label: string; description: string }[] = [ { phase: "research", label: "Research", description: "Understand the codebase and requirements" }, { phase: "plan", label: "Plan", description: "Create a detailed implementation strategy" }, { phase: "implement", label: "Implement", description: "Execute the implementation plan" }, ]; export function NewSessionModal({ onConfirm, onCancel }: NewSessionModalProps) { const [selected, setSelected] = useState("research"); // Close on Escape useEffect(() => { const onKey = (e: KeyboardEvent) => { if (e.key === "Escape") onCancel(); }; window.addEventListener("keydown", onKey); return () => window.removeEventListener("keydown", onKey); }, [onCancel]); return (
e.stopPropagation()}>
New Session

Choose where to start

{phaseOptions.map(({ phase, label, description }) => ( ))}
); }