import { useLocation } from "@tanstack/react-router"; import React from "react"; import { shouldShowAppBar } from "@/components/appBar/appBar"; import WindowControls from "."; import "./windowControls.scss"; const isMac = navigator.userAgent.includes("Macintosh"); /** * Frameless-window fallback for pages that do not draw the app header: * a small drag strip plus the window buttons in the top-right corner. * * Pages with a header (home, library, search, player) put the window buttons * in that header's row instead, so every page has one titlebar plane and the * buttons never float over the avatar or the page controls. */ const WindowChrome = () => { const { pathname } = useLocation(); if (isMac) return null; // The global app header owns the window buttons on these routes. if (shouldShowAppBar(pathname)) return null; // The home page draws its own header inside the hero frame. if (pathname === "/home") return null; // The video/photo players have their own fullscreen UI. if (pathname.startsWith("/player")) return null; // Library and search headers draw the window buttons themselves. if (pathname.startsWith("/library") || pathname.startsWith("/search")) { return null; } // The remote control page has its own titlebar with window buttons. if (pathname.startsWith("/remote")) return null; return (
); }; export default WindowChrome;