import * as api from "@/helpers/api"; import useCurrentUser from "@/hooks/useCurrentUser"; import { useGlobalStore } from "@/store/module"; import { useTranslate } from "@/utils/i18n"; import showAboutSiteDialog from "./AboutSiteDialog"; import Icon from "./Icon"; import UserAvatar from "./UserAvatar"; import Dropdown from "./kit/Dropdown"; const UserBanner = () => { const t = useTranslate(); const globalStore = useGlobalStore(); const { systemStatus } = globalStore.state; const user = useCurrentUser(); const title = user ? user.nickname || user.username : systemStatus.customizedProfile.name || "memos"; const handleAboutBtnClick = () => { showAboutSiteDialog(); }; const handleSignOutBtnClick = async () => { await api.signout(); window.location.href = "/auth"; }; return (