From f3f626b87a6c367033d5bda7dc8091741280f5fa Mon Sep 17 00:00:00 2001
From: hongjli <3117313295@qq.com>
Date: 星期四, 10 四月 2025 14:49:05 +0800
Subject: [PATCH] 聊天页面优化
---
src/components/SceneIntroDialog.tsx | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/components/SceneIntroDialog.tsx b/src/components/SceneIntroDialog.tsx
index 89a999a..dd8c578 100644
--- a/src/components/SceneIntroDialog.tsx
+++ b/src/components/SceneIntroDialog.tsx
@@ -4,11 +4,11 @@
import { Fragment, useEffect, useState } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import DataPreviewDialog from './DataPreviewDialog';
+import { useRouter } from 'next/navigation';
interface SceneIntroDialogProps {
isOpen: boolean;
onClose: () => void;
- onStartChat: () => void;
scene: {
title: string;
description: string;
@@ -17,16 +17,17 @@
instructions?: string;
dataDescription?: string;
exampleData?: string;
+ chatbotId: string;
};
}
export default function SceneIntroDialog({
isOpen,
onClose,
- onStartChat,
scene
}: SceneIntroDialogProps) {
const [showDataPreview, setShowDataPreview] = useState(false);
+ const router = useRouter();
// 纭繚鍔ㄧ敾鐘舵�佸湪姣忔鎵撳紑鏃堕兘琚噸缃�
useEffect(() => {
@@ -42,6 +43,11 @@
});
}
}, [isOpen]);
+
+ const handleStartChat = () => {
+ onClose();
+ router.push(`/ai-scene/chat?scene=${scene.chatbotId}`);
+ };
return (
<AnimatePresence>
@@ -143,7 +149,7 @@
transition={{ duration: 0.5, delay: 0.3 }}
>
<button
- onClick={onStartChat}
+ onClick={handleStartChat}
className="group relative w-64 cursor-pointer"
>
<div className="absolute -inset-0.5 rounded-lg bg-gradient-to-r from-[#6ADBFF] to-[#5E72EB] opacity-60 blur group-hover:opacity-100 transition-all duration-300"></div>
--
Gitblit v1.9.3