diff --git a/apps/database-new/app/NewThreadInput.tsx b/apps/database-new/app/NewThreadInput.tsx
deleted file mode 100644
index 2fca0c6cc71..00000000000
--- a/apps/database-new/app/NewThreadInput.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-'use client'
-
-import { AssistantChatForm } from '@/components/AssistantChatForm'
-import { useAppStateSnapshot } from '@/lib/state'
-import { createClient } from '@/lib/supabase/client'
-
-const NewThreadInput = () => {
- const supabase = createClient()
- const snap = useAppStateSnapshot()
-
- return (
- <>
-
-
+
+
{/* @Terry - just throwing this in here for now.
we may want to reconfigre the h-full/justify-center of the input */}
diff --git a/apps/database-new/components/AssistantChatForm/index.tsx b/apps/database-new/components/AssistantChatForm/index.tsx
index df77176b4cd..7b79e0658df 100644
--- a/apps/database-new/components/AssistantChatForm/index.tsx
+++ b/apps/database-new/components/AssistantChatForm/index.tsx
@@ -2,13 +2,22 @@
import { Loader2 } from 'lucide-react'
import { useParams } from 'next/navigation'
-import { ChangeEvent, FormHTMLAttributes, ReactNode, forwardRef, useRef } from 'react'
+import {
+ ChangeEvent,
+ FormHTMLAttributes,
+ ReactNode,
+ forwardRef,
+ useEffect,
+ useRef,
+ useState,
+} from 'react'
+
import { useFormStatus } from 'react-dom'
import { TextArea_Shadcn_, cn } from 'ui'
-
+import { useAppStateSnapshot } from '@/lib/state'
import { ChatSuggestions } from './ChatSuggestions'
import { upsertMessageFormAction } from './action'
-
+import { createClient } from '@/lib/supabase/client'
export interface FormProps extends FormHTMLAttributes
{
loading?: boolean
disabled?: boolean
@@ -62,18 +71,28 @@ const SubmitButton = forwardRef Promise
}
-const AssistantChatForm = ({
- chatContext,
- placeholder,
- canSubmit = () => Promise.resolve(true),
-}: AssistantChatFormProps) => {
+const AssistantChatForm = ({ placeholder }: AssistantChatFormProps) => {
+ const supabase = createClient()
+ const snap = useAppStateSnapshot()
+
const { thread_id } = useParams()
+
const textAreaRef = useRef(null)
+ const [isLoggedIn, setIsLoggedIn] = useState(false)
+
+ useEffect(() => {
+ async function checkUser() {
+ const {
+ data: { user },
+ } = await supabase.auth.getUser()
+ if (user) setIsLoggedIn(true)
+ }
+ checkUser()
+ })
const disabled = false
@@ -101,10 +120,7 @@ const AssistantChatForm = ({
- {chatContext === 'new' && (
+
+ {!thread_id && (
{
if (textAreaRef?.current) textAreaRef.current.value = v