import { useState, useEffect, ReactNode } from "react" // @mui material components import Card from "@mui/material/Card" import Grid from "@mui/material/Grid" import AppBar from "@mui/material/AppBar" import Tabs from "@mui/material/Tabs" import Tab from "@mui/material/Tab" import Icon from "@mui/material/Icon" // ThreeD Garden components import MDBox from "~/components/mui/MDBox" import MDTypography from "~/components/mui/MDTypography" import MDAvatar from "~/components/mui/MDAvatar" // ThreeD Garden Base Styles import breakpoints from "~/themes/theme-light/base/breakpoints" // Images import profileImage from "~/assets/images/people/team-0.png" import backgroundImage from "~/assets/images/any/bg-profile-garden.jpg" function Header({ children }: { children?: ReactNode }): JSX.Element { const [tabsOrientation, setTabsOrientation] = useState< "horizontal" | "vertical" >("horizontal") const [tabValue, setTabValue] = useState(0) useEffect(() => { // A function that sets the orientation state of the tabs. function handleTabsOrientation() { return window.innerWidth < breakpoints.values.sm ? setTabsOrientation("vertical") : setTabsOrientation("horizontal") } /** The event listener that's calling the handleTabsOrientation function when resizing the window. */ window.addEventListener("resize", handleTabsOrientation) // Call the handleTabsOrientation function to set the state with the initial value. handleTabsOrientation() // Remove event listener on cleanup return () => window.removeEventListener("resize", handleTabsOrientation) }, [tabsOrientation]) const handleSetTabValue = (event: any, newValue: any) => setTabValue(newValue) return ( `${linearGradient( rgba(gradients.info.main, 0.05), rgba(gradients.info.state, 0.1) )}, url(${backgroundImage.src})`, backgroundSize: "cover", backgroundPosition: "50%", overflow: "hidden", }} /> Garden Master Author, Contributor home } /> email } /> settings } /> {children} ) } // Declaring default props for Header Header.defaultProps = { children: "", } export default Header