"use client" import { useTheme } from "next-themes" import Image from "next/image" import Link from "next/link" import { useEffect, useState } from "react" interface LogoProps { className?: string showText?: boolean showColor?: boolean | "dark" | "light" } export function Logo({ className = "block", showText = true, showColor = true }: LogoProps) { const { theme, systemTheme } = useTheme() const [mounted, setMounted] = useState(false) // After mounting, we can access the theme useEffect(() => { setMounted(true) }, []) if (!mounted) { // During SSR and before hydration, we can't know the theme // So return a placeholder with the same dimensions return (
) } const effectiveTheme = theme == "system" ? systemTheme : theme; const isDark = effectiveTheme == "dark"; const logoSrc = showText ? (showColor == true || showColor == theme) ? (isDark ? "/logo-dark.svg" : "/logo.svg") : "/logo-mono.svg" : (showColor == true || showColor == theme) ? (isDark ? "/logo-icon-dark.svg" : "/logo-icon.svg") : "/logo-icon-mono.svg"; return ( TECHTONIC FAULT Logo ) }