"use client"; import React from "react"; import clsx from "clsx"; import { useTranslations } from "next-intl"; import { sidebarData } from "@/lib/database/pathnames"; import { Link, usePathname } from "@/i18n/navigation"; export const Sidebar = () => { const pathname = usePathname(); const t = useTranslations(); 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) => (

{t(item.pathnameKey)}

{item.info.map((obj, i) => ( {t(obj.titleKey)} ))}
))}
); };