56 lines
1.8 KiB
TypeScript
56 lines
1.8 KiB
TypeScript
"use client";
|
|
import React, { useState } from "react";
|
|
import { usePathname } from "next/navigation";
|
|
import { menuItems } from "@/constants";
|
|
import { FaRegBell } from "react-icons/fa";
|
|
import { FaRegUser } from "react-icons/fa";
|
|
|
|
// w-[calc(100%-208px)]
|
|
|
|
const UserHeader = () => {
|
|
const pathname = usePathname();
|
|
const [isMenupage, setIsMenuPage] = useState();
|
|
|
|
const currentMenuItem = menuItems.find((item) => item.href === pathname);
|
|
const titleToShow = currentMenuItem ? currentMenuItem.title : "";
|
|
|
|
// {menuItems.map((menuItem) => (
|
|
// pathname === menuItem.href
|
|
|
|
// // setIsMenuPage(menuItem.title)
|
|
|
|
// ))}
|
|
|
|
return (
|
|
<div className="flex flex-row justify-between items-center fixed top-0 left-0 z-[200] transition-all py-4 px-10 w-[calc(100%-208px)]">
|
|
<div className="flex items-center">
|
|
<p className="cursor-pointer text-[15px] font-bold drop-shadow-md m-0 flex items-center">
|
|
{titleToShow}
|
|
</p>
|
|
</div>
|
|
|
|
<div className="flex items-center">
|
|
{/* Card 1 */}
|
|
<div className="h-10 mx-1 cursor-pointer bg-gray-200 rounded-3xl px-3 pt-0 flex items-center justify-center relative">
|
|
<FaRegBell className="text-lg" />
|
|
</div>
|
|
|
|
{/* Card 2 */}
|
|
<div className="h-10 mx-1 cursor-pointer bg-gray-200 rounded-3xl px-3 pt-0 flex items-center justify-center relative">
|
|
<span className="flex items-center justify-center">
|
|
<div className="flex items-center justify-center relative bg-gray-100 rounded-full w-6 h-6">
|
|
<FaRegUser className="text-gray-200 w-1/2 h-1/2 " />
|
|
</div>
|
|
|
|
<span className="text-xs font-bold opacity-100 transition-all mr-[5px]">
|
|
Yasaman
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default UserHeader;
|