import { useState, type FormEvent, type ReactNode } from "react"; import { Drawer } from "../ui/Drawer"; import type { ProjectInput, Team } from "../../types"; const PROJECT_COLORS = ["#0ea5e9", "#16a34a", "#f97316", "#a855f7", "#facc15", "#ef4444", "#0f766e"]; const LIFECYCLE_STATUSES = [ { value: "planning", label: "Planning" }, { value: "active", label: "Active" }, { value: "on_hold", label: "On hold" }, { value: "completed", label: "Completed" }, ] as const; interface ProjectDrawerProps { open: boolean; editingId: number | null; form: ProjectInput; setForm: (next: ProjectInput) => void; teams: Team[]; onClose: () => void; onSubmit: (event: FormEvent) => void; isSaving: boolean; footerExtras?: ReactNode; } export function ProjectDrawer({ open, editingId, form, setForm, teams, onClose, onSubmit, isSaving, footerExtras, }: ProjectDrawerProps) { const [tab, setTab] = useState<"details" | "notes">("details"); const title = editingId ? `Edit ${form.name || "project"}` : "New project"; return ( } tabs={ <> } footer={ <> {footerExtras} } >
{tab === "details" ? ( <> ) : null} {tab === "notes" ? (