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-10-24 12:10:10 +01:00
|
|
|
import { faGear, faHome, faListCheck, faMaximize, faMinimize, faRotate } 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-10-27 09:35:59 +00:00
|
|
|
import { useIntegrationsContext } from "../../context/IntegrationsContext";
|
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-10-27 09:35:59 +00:00
|
|
|
const { sessionStarted, sessionPaused } = useIntegrationsContext();
|
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-15 11:00:52 +01:00
|
|
|
<div className="relative bg-[#253445] border-b border-gray-500 items-center mx-auto sm:px-3 lg:px-4 py-4 flex flex-col md:flex-row justify-between mb-7 space-y-6 md:space-y-0">
|
|
|
|
|
<div className="w-28">
|
2025-08-13 14:23:48 +01:00
|
|
|
<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-10-24 12:10:10 +01:00
|
|
|
<div className="flex flex-row lg:flex-row space-x-2">
|
|
|
|
|
{sessionStarted && sessionPaused ? (
|
|
|
|
|
<p className="text-gray-400 font-bold">Session Paused</p>
|
|
|
|
|
) : (
|
|
|
|
|
sessionStarted && <p className="text-green-400 font-bold">Session Active</p>
|
|
|
|
|
)}
|
|
|
|
|
</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-10-24 12:10:10 +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
|
|
|
}
|