diff --git a/src/app/(app)/problems/[id]/@TestResult/page.tsx b/src/app/(app)/problems/[id]/@TestResult/page.tsx deleted file mode 100644 index c954c5a..0000000 --- a/src/app/(app)/problems/[id]/@TestResult/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function TestResult() { - return
Test Result
; -} diff --git a/src/app/(app)/problems/[id]/features/bot.tsx b/src/app/(app)/problems/[id]/features/bot.tsx deleted file mode 100644 index c81eb25..0000000 --- a/src/app/(app)/problems/[id]/features/bot.tsx +++ /dev/null @@ -1,125 +0,0 @@ -"use client"; - -import { toast } from "sonner"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; -import { useCallback } from "react"; -import { useChat } from "@ai-sdk/react"; -import { Button } from "@/components/ui/button"; -import { useProblem } from "@/hooks/use-problem"; -import MdxPreview from "@/components/mdx-preview"; -import { Textarea } from "@/components/ui/textarea"; -import { BotIcon, SendHorizonal } from "lucide-react"; -import { ScrollArea } from "@/components/ui/scroll-area"; -import { ChatMessageList } from "@/components/ui/chat/chat-message-list"; -import { ChatBubble, ChatBubbleMessage } from "@/components/ui/chat/chat-bubble"; - -export default function Bot() { - const { problemId, problem, currentLang, currentValue } = useProblem(); - - const { messages, input, handleInputChange, setMessages, handleSubmit } = useChat({ - initialMessages: [ - { - id: problemId, - role: "system", - content: `Problem description:\n${problem.description}`, - }, - ], - }); - - const handleFormSubmit = useCallback( - (e: React.FormEvent) => { - e.preventDefault(); - - if (!input.trim()) { - toast.error("Input cannot be empty"); - return; - } - - const currentCodeMessage = { - id: problemId, - role: "system" as const, - content: `Current code:\n\`\`\`${currentLang}\n${currentValue}\n\`\`\``, - }; - - setMessages((prev) => [...prev, currentCodeMessage]); - handleSubmit(); - }, - [currentLang, currentValue, handleSubmit, input, problemId, setMessages] - ); - - return ( -
-
- {!messages.some( - (message) => message.role === "user" || message.role === "assistant" - ) && ( -
- - Ask Bot - Powered by Vercel Ai SDK -
- )} - -
- - - {messages - .filter( - (message) => message.role === "user" || message.role === "assistant" - ) - .map((message) => ( - - - - - - ))} - - -
-
- -