'use client' import { FC } from 'react' import { Building4, CodeCircle, DocumentText, Element3, Element4, Home2, UserSquare } from 'iconsax-react' import SideBarItem from './SideBarItem' import { useSharedStore } from './store/sharedStore' import { clx } from '../helpers/utils' import Image from 'next/image' import { usePathname } from 'next/navigation' import Button from '@/components/Button' import Link from 'next/link' import { CONSOLE_URL, LOGIN_URL } from '@/config/const' const SideBar: FC = () => { const { openSidebar, setOpenSidebar, isLogin } = useSharedStore() const pathname = usePathname() const isActive = (name: string) => { if (pathname === '/' && name === 'home') { return true } return pathname.includes(name) } const iconSizeSideBar = 20 return ( <> { openSidebar &&
setOpenSidebar(false)} /> }
logo
منو
} title='صفحه اصلی' isActive={isActive('home')} link={'/'} /> } title={'محصولات'} isActive={isActive('products')} link={'/products'} /> } title={'خدمات دناک'} isActive={isActive('danak-services')} link={'/danak-services'} /> } title={'نمایندگان'} isActive={isActive('representatives')} link={'/representatives'} /> } title={'توسعه دهندگان'} isActive={isActive('developers')} link={'/developers'} /> } title={'درباره ما'} isActive={isActive('about')} link={'/about'} /> } title={'مجله'} isActive={isActive('blogs')} link={'/blogs'} /> } title={'تماس با ما'} isActive={isActive('contact')} link={'/contact'} />
{typeof window !== 'undefined' && ( (() => { if (!isLogin) return (
) else return (
) })() )}
) } export default SideBar