"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"; interface LayoutHeaderProps { showTopBar: boolean; } export function LayoutHeader({ showTopBar }: LayoutHeaderProps) { const { theme } = useTheme(); const [path, setPath] = useState(""); 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 (
{path && ( Pangolin )}
{showTopBar && (
)}
); } export default LayoutHeader;