|  |  | 
 |  |  | 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; | 
 |  |  | 
 |  |  |   scene | 
 |  |  | }: SceneIntroDialogProps) { | 
 |  |  |   const [showDataPreview, setShowDataPreview] = useState(false); | 
 |  |  |   const router = useRouter(); | 
 |  |  |  | 
 |  |  |   // 确保动画状态在每次打开时都被重置 | 
 |  |  |   useEffect(() => { | 
 |  |  | 
 |  |  |  | 
 |  |  |   const handleStartChat = () => { | 
 |  |  |     onClose(); | 
 |  |  |     router.push(`/ai-scene/chat?scene=${scene.chatbotId}`); | 
 |  |  |     document.body.classList.add('page-transitioning'); | 
 |  |  |     setTimeout(() => { | 
 |  |  |       window.location.href = `/ai-scene/chat?scene=${scene.chatbotId}`; | 
 |  |  |     }, 100); | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   return ( |