import Link from 'next/link';

import { MedReportLogo } from '@kit/shared/components/med-report-logo';

function LogoImage({
  className,
  compact = false,
}: {
  className?: string;
  width?: number;
  compact?: boolean;
}) {
  return <MedReportLogo compact={compact} className={className} />;
}

export function AppLogo({
  href,
  label,
  className,
  compact = false,
}: {
  href?: string | null;
  className?: string;
  label?: string;
  compact?: boolean;
}) {
  if (href === null) {
    return <LogoImage className={className} compact={compact} />;
  }

  return (
    <Link aria-label={label ?? 'Home Page'} href={href ?? '/'} prefetch={true}>
      <LogoImage className={className} compact={compact} />
    </Link>
  );
}
