Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 2 additions & 32 deletions src/components/agent/agent-panel.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
"use client"

import { useCallback, useRef } from "react"
import { useRef } from "react"
import { X, Bot, Send, Loader2 } from "lucide-react"
import { cn } from "@/lib/utils"
import { MessageList } from "./message-list"
import { useAgentChat } from "./use-agent-chat"

const EXAMPLE_QUESTIONS = [
"What are the most discussed topics?",
"Who talks about Bitcoin?",
"Summarise recent clips about AI",
]

interface AgentPanelProps {
onClose: () => void
}
Expand All @@ -21,15 +15,6 @@ export function AgentPanel({ onClose }: AgentPanelProps) {
useAgentChat()
const textareaRef = useRef<HTMLTextAreaElement>(null)

const handleExampleClick = useCallback(
(question: string) => {
setInput(question)
textareaRef.current?.focus()
handleSubmit(question)
},
[handleSubmit, setInput]
)

const isEmpty = messages.length === 0

return (
Expand Down Expand Up @@ -68,22 +53,7 @@ export function AgentPanel({ onClose }: AgentPanelProps) {
</p>
</div>

<div className="flex flex-col gap-2 w-full max-w-xs">
{EXAMPLE_QUESTIONS.map((q) => (
<button
key={q}
type="button"
onClick={() => handleExampleClick(q)}
className={cn(
"text-left text-xs px-3 py-2.5 rounded-lg border border-border/60",
"bg-muted/30 hover:bg-muted/60 text-foreground/80 hover:text-foreground",
"transition-colors leading-relaxed"
)}
>
{q}
</button>
))}
</div>

</div>
) : (
<MessageList messages={messages} />
Expand Down
Loading