| | |
| | | |
| | | import { useState } from 'react'; |
| | | import Card from '@/components/Card'; |
| | | import ChatDialog from '@/components/ChatDialog'; |
| | | import SceneIntroDialog from '@/components/SceneIntroDialog'; |
| | | import { motion } from 'framer-motion'; |
| | | |
| | |
| | | ]; |
| | | |
| | | export default function AIScenePage() { |
| | | const [isChatOpen, setIsChatOpen] = useState(false); |
| | | const [isIntroOpen, setIsIntroOpen] = useState(false); |
| | | const [currentChatbot, setCurrentChatbot] = useState(''); |
| | | const [selectedScene, setSelectedScene] = useState(services[0]); |
| | | |
| | | const handleCardClick = (service: typeof services[0]) => { |
| | | setSelectedScene(service); |
| | | setIsIntroOpen(true); |
| | | }; |
| | | |
| | | const handleStartChat = () => { |
| | | setIsIntroOpen(false); |
| | | setCurrentChatbot(selectedScene.chatbotId); |
| | | setIsChatOpen(true); |
| | | }; |
| | | |
| | | return ( |
| | |
| | | <SceneIntroDialog |
| | | isOpen={isIntroOpen} |
| | | onClose={() => setIsIntroOpen(false)} |
| | | onStartChat={handleStartChat} |
| | | scene={selectedScene} |
| | | /> |
| | | |
| | | <ChatDialog |
| | | isOpen={isChatOpen} |
| | | onClose={() => setIsChatOpen(false)} |
| | | chatbotId={currentChatbot} |
| | | /> |
| | | </div> |
| | | </> |