|  |  | 
 |  |  | 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 ( | 
 |  |  | 
 |  |  |                                   isOpen={showDataPreview} | 
 |  |  |                                   onClose={() => setShowDataPreview(false)} | 
 |  |  |                                   markdownContent={scene.exampleData} | 
 |  |  |                                   sceneType={scene.chatbotId === 'DfH4cIzujVGvn5iR' || scene.chatbotId === 'zO9YQDEHdIApG9zC' ? 'chadan' :  | 
 |  |  |                                   sceneType={scene.chatbotId === 'RhMYLHI1SZNiX4kl' || scene.chatbotId === 'zO9YQDEHdIApG9zC' ? 'chadan' : | 
 |  |  |                                            scene.chatbotId === 'JELkWpPLHQfRNhEH' ? 'buliao' : undefined} | 
 |  |  |                                 /> | 
 |  |  |                               )} |