2025-08-13 14:23:48 +01:00
|
|
|
import { Link } from "react-router";
|
|
|
|
|
import Logo from "/MAV.svg";
|
2025-08-29 10:07:59 +01:00
|
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
2025-09-18 10:37:23 +01:00
|
|
|
import {
|
|
|
|
|
faGear,
|
2025-09-30 09:07:22 +01:00
|
|
|
faHome,
|
2025-09-18 10:37:23 +01:00
|
|
|
faListCheck,
|
|
|
|
|
faMaximize,
|
|
|
|
|
faMinimize,
|
2025-09-18 15:14:47 +01:00
|
|
|
faRotate,
|
2025-09-18 10:37:23 +01:00
|
|
|
} from "@fortawesome/free-solid-svg-icons";
|
2025-09-30 09:07:22 +01:00
|
|
|
import { useState } from "react";
|
2025-09-23 13:03:54 +01:00
|
|
|
import SoundBtn from "./SoundBtn";
|
2025-09-25 10:38:49 +01:00
|
|
|
import { useNPEDContext } from "../../context/NPEDUserContext";
|
2025-09-09 15:57:35 +01:00
|
|
|
|
|
|
|
|
export default function Header() {
|
2025-09-18 10:37:23 +01:00
|
|
|
const [isFullscreen, setIsFullscreen] = useState(false);
|
2025-09-25 10:38:49 +01:00
|
|
|
const { sessionStarted } = useNPEDContext();
|
2025-09-09 15:57:35 +01:00
|
|
|
|
2025-09-18 10:37:23 +01:00
|
|
|
const toggleFullscreen = () => {
|
|
|
|
|
if (!document.fullscreenElement) {
|
|
|
|
|
document.documentElement.requestFullscreen();
|
|
|
|
|
setIsFullscreen(true);
|
|
|
|
|
} else {
|
|
|
|
|
document.exitFullscreen();
|
|
|
|
|
setIsFullscreen(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-09-18 15:14:47 +01:00
|
|
|
const refreshBrowser = () => {
|
|
|
|
|
window.location.reload();
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-13 14:23:48 +01:00
|
|
|
return (
|
2025-10-03 10:19:49 +01:00
|
|
|
<div className="relative bg-[#253445] border-b border-gray-500 items-center mx-auto px-2 sm:px-6 lg:px-8 p-4 flex flex-col md:flex-row justify-between mb-7 space-y-6 md:space-y-0">
|
2025-08-13 14:23:48 +01:00
|
|
|
<div className="w-30">
|
|
|
|
|
<Link to={"/"}>
|
2025-09-08 15:21:17 +01:00
|
|
|
<img src={Logo} alt="Logo" width={150} height={150} />
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
2025-09-23 16:02:14 +01:00
|
|
|
<div className="flex flex-col lg:flex-row items-center space-x-24 justify-items-center">
|
2025-09-25 10:38:49 +01:00
|
|
|
{sessionStarted && (
|
|
|
|
|
<div className="text-green-400 font-bold">Session Active</div>
|
|
|
|
|
)}
|
2025-09-30 09:07:22 +01:00
|
|
|
|
2025-09-17 14:39:56 +01:00
|
|
|
<div className="flex flex-row space-x-8">
|
2025-09-30 09:07:22 +01:00
|
|
|
<Link to={"/"}>
|
|
|
|
|
<FontAwesomeIcon className="text-white" icon={faHome} size="2x" />
|
|
|
|
|
</Link>
|
2025-09-18 10:37:23 +01:00
|
|
|
<div onClick={toggleFullscreen} className="flex flex-col">
|
|
|
|
|
{isFullscreen ? (
|
|
|
|
|
<FontAwesomeIcon icon={faMinimize} size="2x" />
|
|
|
|
|
) : (
|
|
|
|
|
<FontAwesomeIcon icon={faMaximize} size="2x" />
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2025-09-18 15:14:47 +01:00
|
|
|
<div onClick={refreshBrowser}>
|
|
|
|
|
<FontAwesomeIcon icon={faRotate} size="2x" />
|
|
|
|
|
</div>
|
2025-09-23 16:02:14 +01:00
|
|
|
<SoundBtn />
|
2025-09-12 08:21:52 +01:00
|
|
|
<Link to={"/session-settings"}>
|
2025-09-17 14:39:56 +01:00
|
|
|
<FontAwesomeIcon
|
|
|
|
|
className="text-white"
|
|
|
|
|
icon={faListCheck}
|
|
|
|
|
size="2x"
|
|
|
|
|
/>
|
2025-09-12 08:21:52 +01:00
|
|
|
</Link>
|
2025-09-23 16:02:14 +01:00
|
|
|
|
2025-09-12 08:21:52 +01:00
|
|
|
<Link to={"/system-settings"}>
|
2025-09-17 14:39:56 +01:00
|
|
|
<FontAwesomeIcon className="text-white" icon={faGear} size="2x" />
|
2025-09-12 08:21:52 +01:00
|
|
|
</Link>
|
|
|
|
|
</div>
|
2025-08-13 14:23:48 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2025-09-09 15:57:35 +01:00
|
|
|
}
|