"use client"; import React, { useEffect, useState } from "react"; import Link from "next/link"; import ProfileIcon from "@app/components/ProfileIcon"; import ThemeSwitcher from "@app/components/ThemeSwitcher"; import { useTheme } from "next-themes"; import BrandingLogo from "./BrandingLogo"; import { useEnvContext } from "@app/hooks/useEnvContext"; import { useLicenseStatusContext } from "@app/hooks/useLicenseStatusContext"; interface LayoutHeaderProps { showTopBar: boolean; } export function LayoutHeader({ showTopBar }: LayoutHeaderProps) { const { theme } = useTheme(); const [path, setPath] = useState(""); const { env } = useEnvContext(); const { isUnlocked } = useLicenseStatusContext(); const logoWidth = isUnlocked() ? env.branding.logo?.navbar?.width || 98 : 98; const logoHeight = isUnlocked() ? env.branding.logo?.navbar?.height || 32 : 32; useEffect(() => { function getPath() { let lightOrDark = theme; if (theme === "system" || !theme) { lightOrDark = window.matchMedia("(prefers-color-scheme: dark)") .matches ? "dark" : "light"; } if (lightOrDark === "light") { return "/logo/word_mark_black.png"; } return "/logo/word_mark_white.png"; } setPath(getPath()); }, [theme]); return (
{/* {build === "saas" && ( Cloud Beta )} */}
{showTopBar && (
)}
); } export default LayoutHeader;