import Image from "next/image"
import Link from "next/link"
import { cn } from "@/lib/utils"

type AdminLogoProps = {
  className?: string
  href?: string | null
  variant?: "full" | "mark"
}

export function AdminLogo({
  className,
  href = "/admin/settings",
  variant = "full",
}: AdminLogoProps) {
  const img = (
    <Image
      src="/admin-mark.svg"
      alt="Administration"
      width={variant === "mark" ? 32 : 160}
      height={32}
      className={cn(
        variant === "mark" ? "h-8 w-8" : "h-8 w-auto",
        className
      )}
      priority
    />
  )

  if (href === null) return img

  return (
    <Link href={href} className="inline-flex shrink-0 items-center">
      {img}
    </Link>
  )
}
