From 44f4423082978f6fb199abd48b7bfa4a9267d1cd Mon Sep 17 00:00:00 2001 From: poyrazavsever Date: Sat, 6 Jun 2026 22:06:49 +0300 Subject: [PATCH] refactor: update chat input handling, prune unused settings menu items, and enable turbopack configuration --- app/(dashboard)/chat/page.tsx | 9 ++++++++- app/(dashboard)/settings/page.tsx | 5 +---- components/layout/dashboard-shell.tsx | 8 ++++---- next.config.ts | 1 + 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/(dashboard)/chat/page.tsx b/app/(dashboard)/chat/page.tsx index 3badbd4..a855f8c 100644 --- a/app/(dashboard)/chat/page.tsx +++ b/app/(dashboard)/chat/page.tsx @@ -5,6 +5,7 @@ import { Brain, Send, MessageSquare, Plus, Trash2, Loader2, Wrench } from "lucid import { createClient } from "@/lib/supabase/client"; import { Button } from "poyraz-ui/atoms"; import { useChat } from "@ai-sdk/react"; +import toast from "react-hot-toast"; interface ChatSession { id: string; @@ -18,16 +19,22 @@ export default function AIChatPage() { const [activeSessionId, setActiveSessionId] = useState(null); const messagesEndRef = useRef(null); - const { messages, input, setInput, handleInputChange, handleSubmit, append, setMessages, isLoading, stop } = useChat({ + const [input, setInput] = useState(""); + const { messages, append, setMessages, isLoading, stop } = useChat({ api: "/api/chat", body: { sessionId: activeSessionId }, onError: (err) => { console.error(err); + toast.error(err.message || "Yapay zeka ile iletişim kurulurken bir hata oluştu."); } }); + const handleInputChange = (e: React.ChangeEvent) => { + setInput(e.target.value); + }; + // Auto-scroll to bottom const scrollToBottom = () => { messagesEndRef.current?.scrollIntoView({ behavior: "smooth" }); diff --git a/app/(dashboard)/settings/page.tsx b/app/(dashboard)/settings/page.tsx index 28d0677..ca2e54c 100644 --- a/app/(dashboard)/settings/page.tsx +++ b/app/(dashboard)/settings/page.tsx @@ -1,7 +1,7 @@ "use client"; import { useEffect, useRef, useState } from "react"; -import { User, Bell, Shield, Blocks, Brain, CreditCard, Save, Key, AlertTriangle } from "lucide-react"; +import { User, Shield, Brain, Save, Key, AlertTriangle } from "lucide-react"; import { updatePassword, updateProfile } from "./actions"; import { createClient } from "@/lib/supabase/client"; import { Button, Card, CardContent, Input, Label } from "poyraz-ui/atoms"; @@ -33,9 +33,6 @@ export default function SettingsPage() { { name: "Profile & Account", icon: User }, { name: "AI Preferences", icon: Brain }, { name: "Security", icon: Shield }, - { name: "Integrations", icon: Blocks }, - { name: "Notifications", icon: Bell }, - { name: "Billing & Plans", icon: CreditCard }, ]; useEffect(() => { diff --git a/components/layout/dashboard-shell.tsx b/components/layout/dashboard-shell.tsx index 83fa627..7bda979 100644 --- a/components/layout/dashboard-shell.tsx +++ b/components/layout/dashboard-shell.tsx @@ -48,7 +48,7 @@ export function DashboardShell({ children, user }: DashboardShellProps) { return (
-