From 3f8f0cfc8cc188c25466e9b9f48d492ba609ed21 Mon Sep 17 00:00:00 2001 From: abdou6666 Date: Fri, 7 Feb 2025 18:20:14 +0100 Subject: [PATCH] fix: refactor --- frontend/src/app-components/widget/ChatWidget.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/app-components/widget/ChatWidget.tsx b/frontend/src/app-components/widget/ChatWidget.tsx index ce98aee0..201d5edd 100644 --- a/frontend/src/app-components/widget/ChatWidget.tsx +++ b/frontend/src/app-components/widget/ChatWidget.tsx @@ -6,7 +6,6 @@ * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file). */ - import { Avatar, Box } from "@mui/material"; import UiChatWidget from "hexabot-chat-widget/src/UiChatWidget"; import { useRouter } from "next/router"; @@ -25,8 +24,7 @@ import { ChatWidgetHeader } from "./ChatWidgetHeader"; const SETTING_TYPE = "console_channel" as const; export const ChatWidget = () => { - const router = useRouter(); - const pathname = router.pathname; + const { pathname } = useRouter(); const { apiUrl } = useConfig(); const { isAuthenticated } = useAuth(); const isVisualEditor = pathname.startsWith(`/${RouterType.VISUAL_EDITOR}`);