diff --git a/apps/dashboard/app/(main)/websites/[id]/agent/_components/agent-chat-context.tsx b/apps/dashboard/app/(main)/websites/[id]/agent/_components/agent-chat-context.tsx index d0ccd3819..9c9d54acf 100644 --- a/apps/dashboard/app/(main)/websites/[id]/agent/_components/agent-chat-context.tsx +++ b/apps/dashboard/app/(main)/websites/[id]/agent/_components/agent-chat-context.tsx @@ -1,19 +1,18 @@ "use client"; import { useParams, useRouter } from "next/navigation"; -import { createContext, useContext } from "react"; +import { createContext, type PropsWithChildren, useContext } from "react"; -type AgentChatContextValue = { +interface AgentChatContextValue { chatId: string; setChatId: (id: string) => void; -}; +} const AgentChatContext = createContext(null); -type AgentChatProviderProps = { +interface AgentChatProviderProps extends PropsWithChildren { chatId: string; - children: React.ReactNode; -}; +} export function AgentChatProvider({ chatId, diff --git a/apps/dashboard/app/(main)/websites/[id]/agent/_components/agent-input.tsx b/apps/dashboard/app/(main)/websites/[id]/agent/_components/agent-input.tsx index ec6e67b71..526e7221d 100644 --- a/apps/dashboard/app/(main)/websites/[id]/agent/_components/agent-input.tsx +++ b/apps/dashboard/app/(main)/websites/[id]/agent/_components/agent-input.tsx @@ -3,7 +3,7 @@ import { PaperPlaneRightIcon, StopIcon } from "@phosphor-icons/react"; import { useAtom } from "jotai"; import { Button } from "@/components/ui/button"; -import { Input } from "@/components/ui/input"; +import { Textarea } from "@/components/ui/textarea"; import { useChat } from "@/contexts/chat-context"; import { useEnterSubmit } from "@/hooks/use-enter-submit"; import { cn } from "@/lib/utils"; @@ -37,7 +37,7 @@ export function AgentInput() { setInput(""); }; - const handleChange = (e: React.ChangeEvent) => { + const handleChange = (e: React.ChangeEvent) => { agentCommands.handleInputChange( e.target.value, e.target.selectionStart ?? 0 @@ -57,12 +57,14 @@ export function AgentInput() {
- - + ); } @@ -78,7 +75,6 @@ function AgentPageContentInner({ className={cn( "flex flex-1 flex-col overflow-hidden", "transition-all duration-300 ease-in-out", - false )} >
@@ -111,7 +107,7 @@ function AgentPageContentInner({
- + {hasMessages ? ( ) : ( @@ -135,23 +131,25 @@ function WelcomeState({ onPromptSelect: (text: string) => void; }) { return ( -
- - - - DB - - +
+
+ + + + DB + + -
-

Meet Databunny

-

- Databunny explores your analytics, uncovers patterns, and surfaces - actionable insights without you babysitting every step. -

+
+

Meet Databunny

+

+ Databunny explores your analytics, uncovers patterns, and surfaces + actionable insights without you babysitting every step. +

+
-
+
{[ "Deep Analysis", "Pattern Detection", @@ -167,37 +165,31 @@ function WelcomeState({ ))}
-
-
- - Try asking: -
-
- {SUGGESTED_PROMPTS.map((prompt) => ( - - ))} -
+
+ {SUGGESTED_PROMPTS.map((prompt) => ( + + ))}
); diff --git a/apps/dashboard/app/(main)/websites/[id]/agent/_components/hooks/use-agent-commands.ts b/apps/dashboard/app/(main)/websites/[id]/agent/_components/hooks/use-agent-commands.ts index b1bc45947..130bae765 100644 --- a/apps/dashboard/app/(main)/websites/[id]/agent/_components/hooks/use-agent-commands.ts +++ b/apps/dashboard/app/(main)/websites/[id]/agent/_components/hooks/use-agent-commands.ts @@ -13,7 +13,7 @@ export function useAgentCommands() { const [_, setInput] = useAtom(agentInputAtom); const [showCommands, setShowCommands] = useAtom(showCommandsAtom); const [commandQuery, setCommandQuery] = useAtom(commandQueryAtom); - const inputRef = useRef(null); + const inputRef = useRef(null); const { sendMessage } = useChat(); diff --git a/apps/dashboard/components/ui/textarea.tsx b/apps/dashboard/components/ui/textarea.tsx index 2ff03b5db..61336ebd2 100644 --- a/apps/dashboard/components/ui/textarea.tsx +++ b/apps/dashboard/components/ui/textarea.tsx @@ -4,8 +4,9 @@ import { cn } from '@/lib/utils'; import { motion } from 'framer-motion'; import type { ComponentProps } from 'react'; import { forwardRef, useState } from 'react'; +import TextareaAutosize from 'react-textarea-autosize'; -type TextareaProps = ComponentProps<'textarea'> & { +type TextareaProps = ComponentProps & { showFocusIndicator?: boolean; wrapperClassName?: string; }; @@ -37,7 +38,7 @@ const Textarea = forwardRef( return (
-