Update components/navbar/index.tsx

This commit is contained in:
kleap-admin 2026-01-16 17:01:00 +00:00
parent 7b104e2f28
commit ef5655ff4d
1 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,60 @@
"use client";
import { DesktopNavbar } from "./desktop-navbar";
import { MobileNavbar } from "./mobile-navbar";
import { motion } from "framer-motion";
import { useLanguage } from "@/context/language-provider";
import { LanguageSwitcher } from "@/components/language-switcher";
interface NavItem {
title: string;
link: string;
}
export function NavBar() {
const { t } = useLanguage();
const navItems: NavItem[] = [
{
title: t("home"),
link: "/",
},
{
title: t("report"),
link: "#report",
},
{
title: t("safety"),
link: "#safety",
},
];
return (
<motion.nav
initial={{
y: -80,
}}
animate={{
y: 0,
}}
transition={{
ease: [0.6, 0.05, 0.1, 0.9],
duration: 0.8,
}}
className="max-w-7xl fixed top-4 mx-auto inset-x-0 z-50 w-[95%] lg:w-full"
>
<div className="hidden lg:block w-full">
<div className="flex items-center justify-between">
<DesktopNavbar navItems={navItems} />
<div className="fixed right-10 top-7 z-[60]">
<LanguageSwitcher />
</div>
</div>
</div>
<div className="flex h-full w-full items-center lg:hidden">
<MobileNavbar navItems={navItems} />
<div className="ml-auto mr-4">
<LanguageSwitcher />
</div>
</div>
</motion.nav>
);
}