From 5153c1e1afac75b55ba4ce469de8185e938ac68e Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Mon, 9 Jun 2025 11:00:02 +0330 Subject: [PATCH] change theme chatbot and search --- .env | 2 +- src/chatbot/Chatbot.tsx | 86 ++++----- src/chatbot/ChatbotButton.tsx | 2 +- src/pages/home/hooks/useHomeData.ts | 9 + src/pages/home/service/HomeService.ts | 5 + src/shared/Header.tsx | 265 ++++++++++++++++++++++++-- 6 files changed, 309 insertions(+), 60 deletions(-) diff --git a/.env b/.env index 3a5862f..b559ed3 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ VITE_TOKEN_NAME = 'dzone_token' VITE_REFRESH_TOKEN_NAME = 'dzone_refresh_token' VITE_BASE_URL = 'https://api-dzone.danakcorp.com' -# VITE_BASE_URL = 'http://localhost:4000' +# VITE_BASE_URL = 'https://nhrq9m1d-4000.eun1.devtunnels.ms' VITE_SLUG_ID = 'slug_id' \ No newline at end of file diff --git a/src/chatbot/Chatbot.tsx b/src/chatbot/Chatbot.tsx index 9efdbae..47a54e7 100644 --- a/src/chatbot/Chatbot.tsx +++ b/src/chatbot/Chatbot.tsx @@ -1,5 +1,5 @@ import { FC, useState, useRef, useEffect } from "react"; -import { Send, CloseCircle, Wifi } from "iconsax-react"; +import { Send, CloseCircle, User } from "iconsax-react"; import io, { Socket } from "socket.io-client"; import { SOCKET_EVENTS } from "./constants"; import { useSocketHandlers } from "./hooks/useSocketHandlers"; @@ -423,38 +423,38 @@ const Chatbot: FC = ({ isOpen, onClose }) => { }; // Get connection status icon and text - const getConnectionStatusInfo = () => { - switch (connectionStatus) { - case "connected": - return { - icon: , - text: "متصل", - className: "bg-green-100 text-green-800", - }; - case "connecting": - return { - icon: , - text: "در حال اتصال...", - className: "bg-yellow-100 text-yellow-800", - }; - case "error": - return { - icon: , - text: "خطا در اتصال", - className: "bg-red-100 text-red-800", - }; - default: - return { - icon: , - text: "قطع اتصال", - className: "bg-gray-100 text-gray-800", - }; - } - }; + // const getConnectionStatusInfo = () => { + // switch (connectionStatus) { + // case "connected": + // return { + // icon: , + // text: "متصل", + // className: "bg-green-100 text-green-800", + // }; + // case "connecting": + // return { + // icon: , + // text: "در حال اتصال...", + // className: "bg-yellow-100 text-yellow-800", + // }; + // case "error": + // return { + // icon: , + // text: "خطا در اتصال", + // className: "bg-red-100 text-red-800", + // }; + // default: + // return { + // icon: , + // text: "قطع اتصال", + // className: "bg-gray-100 text-gray-800", + // }; + // } + // }; if (!isOpen) return null; - const connectionInfo = getConnectionStatusInfo(); + // const connectionInfo = getConnectionStatusInfo(); return (
= ({ isOpen, onClose }) => { style={{ height: "500px", direction: "rtl" }} > {/* Header */} -
+
= ({ isOpen, onClose }) => { >

چت بات داناک

{/* Always show a compact connection status */} -
= ({ isOpen, onClose }) => { }`} > {connectionInfo.icon} -
+
*/}
-
- 🤖 +
+ 🤖
)} @@ -621,7 +621,7 @@ const Chatbot: FC = ({ isOpen, onClose }) => { isProcessing || connectionStatus !== "connected" ? "bg-gray-300" - : "bg-blue-600 hover:bg-blue-700" + : "bg-gray-800 hover:bg-gray-900" } text-white rounded-full w-9 h-9 flex items-center justify-center focus:outline-none transition-colors flex-shrink-0`} > { <>