bulk-email/src/components/Header/index.tsx
2025-02-26 15:10:06 +05:30

112 lines
2.8 KiB
TypeScript

import * as React from "react";
import Stack from "@mui/material/Stack";
import Avatar from "@mui/material/Avatar";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import InputBase from "@mui/material/InputBase";
import SearchIcon from "@mui/icons-material/Search";
import Divider from "@mui/material/Divider";
import MenuButton from "../MenuButton";
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
import ColorModeIconDropdown from "../../shared-theme/ColorModeIconDropdown";
import NotificationsRoundedIcon from "@mui/icons-material/NotificationsRounded";
export default function Header() {
const [showNotifications, setShowNotifications] = React.useState(false);
const toggleNotifications = () => {
setShowNotifications((prev) => !prev);
};
return (
<Box
sx={{
width: "100%",
height: "84px",
// backgroundColor: "#202020",
padding: "20px 24px",
display: "flex",
alignItems: "center",
justifyContent: "space-between",
}}
>
<Box sx={{ flexGrow: 1 }} />
<Stack
direction="row"
spacing={3}
alignItems="center"
justifyContent="flex-end"
>
{/* Search Bar */}
<Box
sx={{
width: "360px",
height: "44px",
backgroundColor: "#303030",
borderRadius: "8px",
border: "1px solid #424242",
display: "flex",
alignItems: "center",
padding: "0 12px",
}}
>
<SearchIcon sx={{ color: "#FFFFFF" }} />
<InputBase
sx={{ marginLeft: 1, flex: 1, color: "#FFFFFF" }}
/>
</Box>
{/* Notification and Profile Section */}
<Stack direction="row" spacing={2} alignItems="center">
{/* Custom Bell Icon */}
<MenuButton
showBadge
aria-label="Open notifications"
onClick={toggleNotifications}
>
<NotificationsRoundedIcon />
</MenuButton>
<Divider flexItem sx={{ backgroundColor: "#424242" }} />
<Stack direction="row" spacing={1.5} alignItems="center">
<Avatar
alt="User Avatar"
src="/avatar.png"
sx={{ width: 36, height: 36 }}
/>
<Typography variant="body1" sx={{ color: "#FFFFFF" }}>
Momah
</Typography>
{/* Dropdown Icon */}
<ArrowDropDownIcon
sx={{ color: "#FFFFFF", width: 16, height: 16 }}
/>
</Stack>
<ColorModeIconDropdown />
</Stack>
{showNotifications && (
<Box
sx={{
p: 2,
position: "absolute",
top: "55px",
right: "280px",
bgcolor: "#FFFFFF",
boxShadow: 1,
borderRadius: 1,
zIndex: 1300,
cursor: "pointer",
}}
>
{/* <Typography variant="h6" color="text.primary">
Notifications
</Typography> */}
<Typography variant="body2" color="text.secondary">
No notifications yet
</Typography>
</Box>
)}
</Stack>
</Box>
);
}