Sootzani/components/Navbar.tsx

64 lines
1.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use client";
import React from "react";
import { Input } from "./ui/input";
import Image from "next/image";
import { menuItems } from "@/constants";
import Link from "next/link";
import Login from "./Login";
import { Button } from "./ui/button";
import { usePathname } from 'next/navigation'
import TopNav from "./TopNav";
export default function Navbar() {
const pathname = usePathname()
return (
<div className={`max-md:hidden left-0 right-0 top-0 z-10 ${pathname === "/" ? "absolute" : "sticky"}`}>
<TopNav />
<div className=" bg-white h-16 shadow-md flex items-center justify-between py-2 px-8">
<div className=" flex ">
<div className=" flex items-center ">
<Image
src="/img/logo.png"
quality={100}
alt="log"
width={32}
height={32}
/>
<div className=" text-brown flex flex-col text-center w-40">
<h1 className="text-[21px] w-full">ســــــــوت زن</h1>
<h1 className="text-[9px]">سامانه افشار فساد شهرداری</h1>
</div>
</div>
<div className=" flex gap-5 items-center mr-8">
{menuItems.map((item, index, array) => {
if (array.length - 1 !== index){
return (
<Link key={item.id} href={item.href}>
<div className=" text-sm font-bold">{item.name}</div>
</Link>
);
}else{
return (
<></>
);
}
})}
</div>
</div>
<Link href="/Login" >
<Button className=" bg-blue hover:bg-blue/90 rounded-lg">
ورود به پنل کاربری
</Button>
</Link>
</div>
</div>
);
}