diff --git a/gpt-db-chat/app/app.css b/gpt-db-chat/app/app.css index 2bbddb7..3ef130a 100644 --- a/gpt-db-chat/app/app.css +++ b/gpt-db-chat/app/app.css @@ -41,10 +41,6 @@ font-feature-settings: "rlig" 1, "calt" 1; } - body { - @apply flex h-screen flex-col overflow-hidden; - } - input, textarea { @apply bg-[color:var(--background)] text-[color:var(--foreground)]; diff --git a/gpt-db-chat/app/chat/chat.tsx b/gpt-db-chat/app/chat/chat.tsx index cd6a37f..c37a078 100644 --- a/gpt-db-chat/app/chat/chat.tsx +++ b/gpt-db-chat/app/chat/chat.tsx @@ -2,7 +2,10 @@ import { useLocalStorage } from "@uidotdev/usehooks"; import { useEffect, useState } from "react"; import { Form, useSearchParams } from "react-router"; import { Table } from "~/components/table"; -import { useMcpSql, type ChatResponse } from "~/hooks/use-mcp-sql"; +import { + useQuestionToSqlResult, + type ChatResponse, +} from "~/hooks/use-question-to-sql-result"; export function Chat() { const [searchParams] = useSearchParams(); @@ -16,7 +19,7 @@ export function Chat() { ); const [chatResponse, setChatResponse] = useState(null); - const { isError, isLoading, retry, error, call } = useMcpSql(); + const { isLoading, isError, call } = useQuestionToSqlResult(); useEffect(() => { async function fetchChatResponse() { @@ -76,14 +79,11 @@ export function Chat() { onChange={(e) => setQuestionInput(e.target.value)} placeholder="Ask a question about your database..." className="input-base flex-1" - disabled={isError} /> - - {/* Results Section */} - {isError ? ( -
-

Connection failed: {error}

- -
- ) : null} - + {isError &&

Error occurred

} {chatResponse && (
{/* SQL Query Display */} @@ -139,7 +131,7 @@ export function Chat() { {chatResponse.result && (

Query Results:

-
+
diff --git a/gpt-db-chat/app/components/navbar.tsx b/gpt-db-chat/app/components/navbar.tsx index 9632608..5a505ed 100644 --- a/gpt-db-chat/app/components/navbar.tsx +++ b/gpt-db-chat/app/components/navbar.tsx @@ -7,7 +7,7 @@ export function Navbar() {