From bb0e11ef94717dac364a244c9b97ada7a3c7288d Mon Sep 17 00:00:00 2001 From: Ando Date: Mon, 14 Apr 2025 20:42:28 +0300 Subject: [PATCH] fix: remove ai features --- .../studio/reports/[reportSlug]/ai/page.tsx | 129 ------------------ src/app/api/health/route.ts | 17 --- src/components/mods/studio/studio-sidebar.tsx | 17 --- 3 files changed, 163 deletions(-) delete mode 100644 src/app/(studio)/studio/reports/[reportSlug]/ai/page.tsx delete mode 100644 src/app/api/health/route.ts diff --git a/src/app/(studio)/studio/reports/[reportSlug]/ai/page.tsx b/src/app/(studio)/studio/reports/[reportSlug]/ai/page.tsx deleted file mode 100644 index b715753..0000000 --- a/src/app/(studio)/studio/reports/[reportSlug]/ai/page.tsx +++ /dev/null @@ -1,129 +0,0 @@ -'use client' - -import { icons } from 'lucide-react' -import React, { useState, useRef, useEffect } from 'react' - -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' -import { Icon } from '@/components/ui/icon' -import { Switch } from '@/components/ui/switch' -import { analyzeTemplates } from '@/lib/constants' -import { Message } from '@/lib/definitions' -import { ChatMode } from '@/components/mods/studio/ai/chat-mode' -import { PromptMode } from '@/components/mods/studio/ai/prompt-mode' - -import { useAI } from '@/hooks/use-ai' - -const Page = () => { - const [isChatMode, setIsChatMode] = useState(false) - const { responseData, isLoading, fetchData } = useAI(isChatMode ? 'chat' : 'prompt') - - const [messages, setMessages] = useState([ - { - role: 'assistant', - content: "Hello! I'm Drowser AI. Choose an analysis template to begin." - } - ]) - const [inputValue, setInputValue] = useState('') - const scrollAreaRef = useRef(null) - - const handleSubmit = async () => { - if (!inputValue.trim()) return - - if (isChatMode) { - setMessages((prev) => [...prev, { role: 'user', content: inputValue }]) - } - - await fetchData(isChatMode ? messages : inputValue) - - if (isChatMode) { - setMessages((current) => [ - ...current, - { - role: 'assistant', - content: responseData || "I'm sorry, I couldn't understand your request." - } - ]) - } - - setInputValue('') - } - - const handlePromptClick = (input: string) => setInputValue(input) - - useEffect(() => { - if (scrollAreaRef.current) { - scrollAreaRef.current.scrollTop = scrollAreaRef.current.scrollHeight - } - }, [messages, isLoading]) - - return ( -
-
- {analyzeTemplates.map((template) => ( - - -
- -
-
- {template.title} - {template.description} -
-
- -
- {template.prompts.map((prompt, index) => ( - - ))} -
-
-
- ))} -
- - {/* Mode Switch */} -
-
-
- Prompt - - Chat -
-
-
- - {/* Chat Interface */} - {isChatMode ? ( - - ) : ( - - )} - - {/* Disclaimer */} -
- Drowser AI can make mistakes. Consider checking important information. -
-
- ) -} - -export default Page diff --git a/src/app/api/health/route.ts b/src/app/api/health/route.ts deleted file mode 100644 index 286648d..0000000 --- a/src/app/api/health/route.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { env } from 'process' - -const startTime = Date.now() - -export const GET = () => { - const healthInfo = { - status: 'healthy', - environment: env.NODE_ENV, - uptime: Math.floor((Date.now() - startTime) / 1000), - timestamp: new Date().toISOString() - } - - return new Response(JSON.stringify(healthInfo), { - status: 200, - headers: { 'Content-Type': 'application/json' } - }) -} diff --git a/src/components/mods/studio/studio-sidebar.tsx b/src/components/mods/studio/studio-sidebar.tsx index 87cee36..a6c1728 100644 --- a/src/components/mods/studio/studio-sidebar.tsx +++ b/src/components/mods/studio/studio-sidebar.tsx @@ -213,23 +213,6 @@ export const StudioSidebar = () => { - - {/* - - - - - - Drowser AI - Experimental - - - - - */}