import { AddIcon, ArrowBackIcon, ArrowLeftIcon, ArrowRightIcon, SearchIcon, } from "@chakra-ui/icons"; import { Avatar, Box, Button, HStack, Icon, Image, Input, InputGroup, InputLeftElement, Menu, MenuButton, MenuList, Popover, PopoverArrow, PopoverBody, PopoverContent, PopoverFooter, PopoverTrigger, Portal, Text, useColorMode, VStack, } from "@chakra-ui/react"; import React, { useContext, useState } from "react"; import { Link, useNavigate } from "react-router-dom"; import * as XLSX from "xlsx"; import GlobalStateContext from "../Contexts/GlobalStateContext"; import mainLogo from "../assets/optifii_logo.svg"; import { MdNotificationsNone } from "react-icons/md"; import womenpfp from "../assets/womenpfp1.png"; import { MdLogout } from "react-icons/md"; import { IoFilterSharp } from "react-icons/io5"; import { MdDeleteOutline, MdOutlineDelete } from "react-icons/md"; import { IoIosCheckmark } from "react-icons/io"; const users = [ { id: 1, user: "Jenny Wilson", role: "Admin" }, { id: 2, user: "Jenny Wilson", role: "Employee" }, ]; const HeaderMain = ({ logOutHandler, slideDirecttion, isDrawerOpen, toggleDrawer, blur, }) => { const navigate = useNavigate(); const { colorMode, toggleColorMode } = useContext(GlobalStateContext); const [searchTerm, setSearchTerm] = useState(""); const [notifications, setNotifications] = useState([ { id: 1, avatar: "https://bit.ly/dan-abramov", sender: "Admin", time: "1 Min ago", message: "Lorem ipsum dolor sit amet, consectetur", }, { id: 2, avatar: "https://bit.ly/code-beast", sender: "Support", time: "5 Min ago", message: "Your ticket has been updated.", }, ]); // Handler to delete a notification const handleDelete = (id) => { setNotifications( notifications.filter((notification) => notification.id !== id) ); }; // Handler to delete all notifications const handleDeleteAll = () => { setNotifications([]); }; const openDrawerOnClick = () => {}; return ( Logo !blur && navigate("/")} cursor={"pointer"} /> {!blur && ( setSearchTerm(e.target.value)} /> )} {/* */} Notification Clear all Today {notifications.map((notification) => ( {notification.sender} {notification.sender} {notification.time} {notification.message} handleDelete(notification.id)} cursor="pointer" > ))} Yesterday {notifications.map((notification) => ( {notification.sender} {notification.sender} {notification.time} {notification.message} handleDelete(notification.id)} cursor="pointer" > ))} navigate("/notification")} cursor="pointer" fontSize="small" color="#6311CB" fontWeight={600}> View All View Profile {/* Help & Support */} Switch Accounts {users.map((val) => { return ( // Profile Picture {val.user} {val.role} // ); })} Sign out of all accounts {blur ? ( Hello, Developers mailto:wdi@tanami.com ) : ( Hello, Developers mailto:wdi@tanami.com )} ); }; export default HeaderMain;