import { useEffect } from "react"; import { NavLink, useLocation } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { useLayoutStore, useUserStore } from "@/store/module"; import { resolution } from "@/utils/layout"; import Icon from "./Icon"; import showSettingDialog from "./SettingDialog"; import showAskAIDialog from "./AskAIDialog"; import showArchivedMemoDialog from "./ArchivedMemoDialog"; import showAboutSiteDialog from "./AboutSiteDialog"; import UserBanner from "./UserBanner"; const Header = () => { const { t } = useTranslation(); const location = useLocation(); const userStore = useUserStore(); const layoutStore = useLayoutStore(); const showHeader = layoutStore.state.showHeader; const isVisitorMode = userStore.isVisitorMode() && !userStore.state.user; useEffect(() => { const handleWindowResize = () => { if (window.innerWidth < resolution.sm) { layoutStore.setHeaderStatus(false); } else { layoutStore.setHeaderStatus(true); } }; window.addEventListener("resize", handleWindowResize); handleWindowResize(); }, [location]); return (