import Link from "next/link";

type LogoProps = {
  href?: string;
  className?: string;
  showWordmark?: boolean;
};

/** Shared logo (mark + optional wordmark). Use in header, footer, auth. */
export function Logo({ href = "/", className = "", showWordmark = true }: LogoProps) {
  const content = (
    <>
      <div className="flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-white shadow-[0_12px_30px_var(--gradient-glow)] transition-transform group-hover:scale-105"
        style={{ background: "linear-gradient(to right, var(--gradient-start), var(--gradient-mid), var(--gradient-end))" }}>
        <span className="font-bold text-sm">L1</span>
      </div>
      {showWordmark && (
        <span className="text-lg font-bold tracking-tight text-foreground">LedgerOne</span>
      )}
    </>
  );

  if (href) {
    return (
      <Link href={href} className={`flex items-center gap-2 group ${className}`}>
        {content}
      </Link>
    );
  }

  return <div className={`flex items-center gap-2 ${className}`}>{content}</div>;
}
