Files
dzone-front/src/chatbot/ChatbotButton.tsx
T
hamid zarghami 9334e09ac6 chatbot debug
2025-06-08 16:21:37 +03:30

27 lines
850 B
TypeScript

import { FC, useState } from 'react';
import { MessageText1 } from 'iconsax-react';
import Chatbot from './Chatbot';
const ChatbotButton: FC = () => {
const [isChatbotOpen, setIsChatbotOpen] = useState<boolean>(false);
const toggleChatbot = () => {
setIsChatbotOpen(!isChatbotOpen);
};
return (
<>
<button
onClick={toggleChatbot}
className="fixed bottom-5 right-5 bg-blue-600 text-white rounded-full w-14 h-14 flex items-center justify-center shadow-lg hover:bg-blue-700 transition-colors z-40"
aria-label="چت با پشتیبانی"
>
<MessageText1 size={24} />
</button>
<Chatbot isOpen={isChatbotOpen} onClose={() => setIsChatbotOpen(false)} />
</>
);
};
export default ChatbotButton;