2024-06-20 12:09:48 +05:30
|
|
|
import { AddIcon } from "@chakra-ui/icons";
|
|
|
|
|
import {
|
|
|
|
|
Avatar,
|
|
|
|
|
Box,
|
|
|
|
|
Button,
|
|
|
|
|
Popover,
|
|
|
|
|
PopoverArrow,
|
|
|
|
|
PopoverBody,
|
|
|
|
|
PopoverContent,
|
|
|
|
|
PopoverFooter,
|
|
|
|
|
PopoverTrigger,
|
|
|
|
|
Portal,
|
|
|
|
|
Text,
|
2024-06-25 19:16:55 +05:30
|
|
|
useColorMode,
|
2024-06-20 12:09:48 +05:30
|
|
|
} from "@chakra-ui/react";
|
2024-06-25 19:16:55 +05:30
|
|
|
import React, { useContext } from "react";
|
2024-06-20 12:09:48 +05:30
|
|
|
import { Link } from "react-router-dom";
|
|
|
|
|
import { IoMdDownload } from "react-icons/io";
|
|
|
|
|
import * as XLSX from "xlsx";
|
|
|
|
|
import { useGetNewsLetterEmailQuery } from "../Services/api.service";
|
2024-06-25 19:16:55 +05:30
|
|
|
import profile from "../assets/proavatar.webp";
|
|
|
|
|
import GlobalStateContext from "../Contexts/GlobalStateContext";
|
|
|
|
|
import { MdOutlineDarkMode, MdOutlineLightMode } from "react-icons/md";
|
2024-06-20 12:09:48 +05:30
|
|
|
|
2024-06-25 19:16:55 +05:30
|
|
|
const HeaderMain = ({
|
|
|
|
|
link,
|
|
|
|
|
btnTitle,
|
|
|
|
|
title,
|
|
|
|
|
icon,
|
|
|
|
|
logOutHandler,
|
|
|
|
|
slideDirecttion,
|
|
|
|
|
}) => {
|
|
|
|
|
const { colorMode, toggleColorMode } = useContext(GlobalStateContext);
|
2024-06-24 12:08:21 +05:30
|
|
|
|
2024-06-20 12:09:48 +05:30
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Box
|
2024-06-25 19:16:55 +05:30
|
|
|
className={` pt-2 pb-2 fw-400 border-bottom d-flex ${
|
|
|
|
|
slideDirecttion ? "flex-row-reverse ps-2" : ""
|
|
|
|
|
} justify-content-between align-items-center`}
|
2024-06-20 12:09:48 +05:30
|
|
|
>
|
|
|
|
|
<Text
|
|
|
|
|
as={"span"}
|
2024-06-24 12:08:21 +05:30
|
|
|
fontWeight={"500"}
|
2024-06-25 19:16:55 +05:30
|
|
|
// color={"forestGreen.500"}
|
2024-06-20 12:09:48 +05:30
|
|
|
className="fs-6 "
|
|
|
|
|
>
|
|
|
|
|
{/* <icon /> */}
|
|
|
|
|
{title}
|
|
|
|
|
</Text>
|
|
|
|
|
|
2024-06-25 19:16:55 +05:30
|
|
|
|
|
|
|
|
<Box me={4} gap={2} className="d-flex justify-content-center ">
|
2024-06-20 12:09:48 +05:30
|
|
|
<Popover placement="bottom">
|
|
|
|
|
<Portal>
|
|
|
|
|
<PopoverContent maxW="200px" className="">
|
|
|
|
|
<PopoverArrow />
|
|
|
|
|
<PopoverBody className="web-text-medium pointer link">
|
|
|
|
|
Profile
|
|
|
|
|
</PopoverBody>
|
|
|
|
|
<Link to={"/help-and-support"}>
|
|
|
|
|
<PopoverBody className="web-text-medium pointer ">
|
|
|
|
|
Help & Support
|
|
|
|
|
</PopoverBody>
|
|
|
|
|
</Link>
|
|
|
|
|
<PopoverFooter
|
|
|
|
|
onClick={logOutHandler}
|
|
|
|
|
className="web-text-medium pointer link"
|
|
|
|
|
>
|
|
|
|
|
Log Out
|
|
|
|
|
</PopoverFooter>
|
|
|
|
|
</PopoverContent>
|
|
|
|
|
</Portal>
|
|
|
|
|
<PopoverTrigger>
|
|
|
|
|
<Box
|
|
|
|
|
// onClick={logOutHandler}
|
|
|
|
|
className="d-flex pointer align-items-center"
|
|
|
|
|
>
|
|
|
|
|
<Avatar
|
|
|
|
|
size="sm"
|
2024-06-25 19:16:55 +05:30
|
|
|
boxSize={37}
|
2024-06-20 12:09:48 +05:30
|
|
|
name="Dan Abrahmov"
|
2024-06-24 18:47:59 +05:30
|
|
|
src={profile}
|
2024-06-20 12:09:48 +05:30
|
|
|
/>
|
|
|
|
|
<Box
|
|
|
|
|
style={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
}}
|
|
|
|
|
className=" overflow-hidden ms-3 flex-column "
|
|
|
|
|
>
|
|
|
|
|
<Text as={"span"} className="web-text-small">
|
|
|
|
|
Hello, developer admin
|
|
|
|
|
</Text>
|
|
|
|
|
<Text as={"span"} className="web-text-xsmall">
|
|
|
|
|
siddhesh@rubix.com
|
|
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
</PopoverTrigger>
|
|
|
|
|
</Popover>
|
2024-06-25 19:16:55 +05:30
|
|
|
|
|
|
|
|
{/* <Box onClick={() => toggleColorMode()} as="span" p={2} rounded={'lg'} className="link pointer">
|
|
|
|
|
{colorMode === "light"? <MdOutlineDarkMode /> :<MdOutlineLightMode />}
|
|
|
|
|
</Box> */}
|
2024-06-20 12:09:48 +05:30
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default HeaderMain;
|