import Input from "@/components/Input"; import { type FC, useEffect } from "react"; // import { ArrowDown2, CloseCircle, HambergerMenu, Logout, Wallet } from 'iconsax-react' // import AvatarImage from '../assets/images/avatar_image.png' import { Paths } from "@/config/Paths"; import { clx } from "@/helpers/utils"; import { useSharedStore } from "@/shared/store/sharedStore"; import { Eye, HambergerMenu } from "iconsax-react"; import { useTranslation } from "react-i18next"; import { Link, useLocation } from "react-router-dom"; type SidebarSize = "default" | "wide"; type HeaderProps = { hasMainSidebar?: boolean; sidebarSize?: SidebarSize; }; const sidebarSizeClasses: Record< SidebarSize, { base: string; withSub: string } > = { default: { base: "xl:right-[285px] xl:w-[calc(100%-305px)]", withSub: "xl:right-[320px] xl:w-[calc(100%-340px)]", }, wide: { base: "xl:right-[390px] xl:w-[calc(100%-406px)]", withSub: "xl:right-[425px] xl:w-[calc(100%-441px)]", }, }; const Header: FC = ({ hasMainSidebar = true, sidebarSize = "default", }) => { // const location = useLocation(); // const [popoverKey, setPopoverKey] = useState(0); const { t } = useTranslation("global"); const { setOpenSidebar, openSidebar, hasSubMenu, setSearch, editorCatalogSlug, } = useSharedStore(); const location = useLocation(); const editorPathPrefix = `${Paths.editor}/`; const isEditorRoute = location.pathname.startsWith(editorPathPrefix) && location.pathname.length > editorPathPrefix.length; const viewerSlug = isEditorRoute ? (editorCatalogSlug ?? "") : ""; // useEffect(() => { // setPopoverKey((prevKey) => prevKey + 1); // }, [location.pathname]); // const handleLogout = () => { // removeToken() // removeRefreshToken() // window.location.href = Pages.auth.login // } useEffect(() => { setSearch(""); // eslint-disable-next-line react-hooks/exhaustive-deps }, [location.pathname]); return (
setSearch(value)} />
setOpenSidebar(!openSidebar)} className="xl:hidden block" >
{/* */}
{isEditorRoute && viewerSlug ? ( ) : null} {/* */} {/* */} {/* { data && (
{data?.data?.user?.firstName + ' ' + data?.data?.user?.lastName}
setPopoverKey((prevKey) => prevKey + 1)} size={20} color='#da2129' />
{data?.data?.user?.firstName + ' ' + data?.data?.user?.lastName}
{data?.data?.user?.email}
handleLogout()} className='flex gap-2 items-center cursor-pointer'>
{t('sidebar.logout')}
) } */}
); }; export default Header;