"use client"; import React from "react"; import { sidebarLinks } from "../../../constants/index"; // import Link from "next/link"; import Image from "next/image"; import { useTranslations } from "next-intl"; import Link from "next-intl/link"; import { redirect } from "next-intl/server"; import { usePathname, useRouter } from "next/navigation"; const Header = () => { const t = useTranslations(); const router = useRouter(); const pathname = usePathname(); let currentPath = pathname; const pathWithoutLocale = pathname.replace(/^\/vn/, ""); for (const link of sidebarLinks) { if (pathWithoutLocale === link.route) { currentPath = pathWithoutLocale; break; } if (pathWithoutLocale == "") { currentPath = "/"; } } console.log(currentPath); return (