refactor: update chat input handling, prune unused settings menu items, and enable turbopack configuration

This commit is contained in:
poyrazavsever
2026-06-06 22:06:49 +03:00
parent 4a52deec4d
commit 44f4423082
4 changed files with 14 additions and 9 deletions
+8 -1
View File
@@ -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<string | null>(null);
const messagesEndRef = useRef<HTMLDivElement>(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<HTMLTextAreaElement>) => {
setInput(e.target.value);
};
// Auto-scroll to bottom
const scrollToBottom = () => {
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
+1 -4
View File
@@ -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(() => {