"use client";
import Link from "next/link";
import { useState } from "react";
import { HABIT_LOGO_SRC } from "@/lib/brand";
import { routes } from "@/lib/routes";
import { cn } from "@/lib/utils";
const logoSizeClass = {
sm: "h-6 w-auto max-h-6",
md: "h-8 w-auto max-h-8",
/** Compact — leaves vertical padding inside the top bar */
nav: "h-7 w-auto max-h-7 sm:h-8 sm:max-h-8",
lg: "h-12 w-auto max-h-12 sm:h-14",
hero: "h-16 w-auto max-h-16 sm:h-20 md:h-24",
} as const;
type HabitBrandProps = {
className?: string;
href?: string;
size?: keyof typeof logoSizeClass;
/** Show retro frame around the logo (top bar / site header). */
framed?: boolean;
"aria-current"?: "page" | undefined;
};
export function HabitBrand({
className,
href = routes.home,
size = "sm",
framed = true,
"aria-current": ariaCurrent,
}: HabitBrandProps) {
const [useText, setUseText] = useState(false);
return (
{!useText ? (
// eslint-disable-next-line @next/next/no-img-element
setUseText(true)}
/>
) : (
HaBit
)}
);
}