import { useState } from "react"; import { SelectDropdown } from "../ui/SelectDropdown"; import { BackupPage } from "./BackupPage"; import { RestorePage } from "./RestorePage"; import { SyncPage } from "./SyncPage"; type ToolOperation = "backup" | "restore" | "sync"; const OPERATION_OPTIONS = [ { value: "backup", label: "Backup" }, { value: "restore", label: "Restore" }, { value: "sync", label: "DB Sync" }, ]; export function ToolsPage({ connectionId }: { connectionId: string }) { const [operation, setOperation] = useState("backup"); return (
{/* Operation switcher toolbar */}
setOperation(v as ToolOperation)} options={OPERATION_OPTIONS} variant="ghost" aria-label="Operation" />
{/* Content — BackupPage/RestorePage/SyncPage each render their own toolbar header and flex-1 overflow-y-auto scroll container, so this wrapper only provides a definite height (h-full resolves against it). */}
{operation === "backup" && } {operation === "restore" && } {operation === "sync" && }
); }