import Link from 'next/link';

import { site } from '@/lib/marketing';
import { cn } from '@/lib/utils';

export function Logo({
  className,
  href = '/',
  markOnly = false,
}: {
  className?: string;
  href?: string;
  markOnly?: boolean;
}) {
  return (
    <Link href={href} className={cn('inline-flex items-center gap-2.5 text-foreground', className)}>
      <span className="grid h-8 w-8 place-items-center rounded-xl bg-brand-gradient text-primary-foreground shadow-sm" aria-hidden="true">
        <svg viewBox="0 0 24 24" className="h-4 w-4" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
          <path d="M4 8.5 12 4l8 4.5v7L12 20l-8-4.5v-7Z" />
          <path d="M12 12v8" />
          <path d="M12 12 4 8.5" />
          <path d="m12 12 8-3.5" />
          <path d="M16 7.5 9.5 11" />
        </svg>
      </span>
      {markOnly ? <span className="sr-only">{site.name}</span> : <span className="font-display text-[1.05rem] font-extrabold tracking-tight">{site.name}</span>}
    </Link>
  );
}
