feat: add SQL editor, query results, and workspace panels

Add CodeMirror 6 SQL editor with Ctrl+Enter execution, ResultsTable
with virtual scrolling and resizable columns, ResultsPanel, EditableCell,
WorkspacePanel (editor + results split), and TabContent router.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-11 19:06:48 +03:00
parent d333732346
commit 13a8535b5c
6 changed files with 520 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
import { useAppStore } from "@/stores/app-store";
import { WorkspacePanel } from "./WorkspacePanel";
import { TableDataView } from "@/components/table-viewer/TableDataView";
import { TableStructure } from "@/components/table-viewer/TableStructure";
export function TabContent() {
const { tabs, activeTabId, updateTab } = useAppStore();
const activeTab = tabs.find((t) => t.id === activeTabId);
if (!activeTab) {
return (
<div className="flex h-full items-center justify-center text-sm text-muted-foreground">
Open a query tab or select a table to get started.
</div>
);
}
switch (activeTab.type) {
case "query":
return (
<WorkspacePanel
key={activeTab.id}
connectionId={activeTab.connectionId}
initialSql={activeTab.sql}
onSqlChange={(sql) => updateTab(activeTab.id, { sql })}
/>
);
case "table":
return (
<TableDataView
key={activeTab.id}
connectionId={activeTab.connectionId}
schema={activeTab.schema!}
table={activeTab.table!}
/>
);
case "structure":
return (
<TableStructure
key={activeTab.id}
connectionId={activeTab.connectionId}
schema={activeTab.schema!}
table={activeTab.table!}
/>
);
default:
return null;
}
}