"use client"; import React from "react"; import Link from "next/link"; import clsx from "clsx"; import { usePathname } from "next/navigation"; import { sidebarData } from "@/lib/database/pathnames"; import { useAppSelector } from "@/redux/hooks"; export const Sidebar = () => { const pathname = usePathname(); const lang = useAppSelector( (state) => state.headerSlice.activeLang.localization ); return (
{sidebarData .filter( (obj) => (pathname === "/company/aboutus" && obj.company) || (pathname.includes("/members") && obj.members) || (pathname.includes("/news") && obj.news) || (pathname.includes("/visitors") && obj.visitors) || (pathname.includes("/services") && obj.services) ) .map((item, i) => (

{lang === "ru" ? item.pathname : item.pathnameEn}

{item.info.map((obj, i) => ( {lang === "ru" ? obj.title : obj.titleEn} ))}
))}
); };