"use client"; import React, { useEffect, useState } from "react"; import Image from "next/image"; 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 { Badge } from "./ui/badge"; import { build } from "@server/build"; interface LayoutHeaderProps { showTopBar: boolean; } export function LayoutHeader({ showTopBar }: LayoutHeaderProps) { const { theme } = useTheme(); const [path, setPath] = useState(""); const { env } = useEnvContext(); 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;