diff --git a/src/shared/Header.tsx b/src/shared/Header.tsx index 0189132..c6ea7f4 100644 --- a/src/shared/Header.tsx +++ b/src/shared/Header.tsx @@ -1,31 +1,19 @@ -import { type FC, useEffect } from 'react' +import { type FC } from 'react' import Input from '@/components/Input' import { HambergerMenu, Wallet } from 'iconsax-react' -// import AvatarImage from '@/assets/images/avatar_image.png' -import { useLocation } from 'react-router-dom' import Notifications from '@/pages/notification/Notification' import { useSharedStore } from './store/useSharedStore' -// import { useGetProfile } from '@/pages/profile/hooks/useProfileData' -// import { Popover, PopoverButton, PopoverPanel } from '@headlessui/react' -// import SidebarItem from './SidebarItem' -// import { useGetWalletBalance } from '@/pages/wallet/hooks/useWalletData' -// import { NumberFormat } from '../config/func' import { t } from '@/locale' import { useGetMe } from '@/pages/user/hooks/useUserData' import { NumberFormat } from '@/config/func' const Header: FC = () => { - const location = useLocation(); const { data } = useGetMe() - // const [popoverKey, setPopoverKey] = useState(0); const { setOpenSidebar, openSidebar } = useSharedStore() - // const { data } = useGetProfile() - // const getWalletBalance = useGetWalletBalance() - useEffect(() => { - // setPopoverKey((prevKey) => prevKey + 1); - }, [location.pathname]); + const displayName = [data?.firstName, data?.lastName].filter(Boolean).join(' ').trim() + const initials = `${String(data?.firstName ?? '').charAt(0)}${String(data?.lastName ?? '').charAt(0)}` return (