import { Link } from "react-router-dom";
import { cn } from "@/lib/utils.ts";

type LogoProps = {
  to?: string;
  showTagline?: boolean;
  className?: string;
  size?: "sm" | "md" | "lg";
};

export function Logo({ to = "/", showTagline = false, className, size = "md" }: LogoProps) {
  const sizeClasses = {
    sm: "h-8",
    md: "h-10",
    lg: "h-12",
  };

  const logoElement = (
    <img
      src="/logo.svg"
      alt="Afritech Logistics"
      className={cn(sizeClasses[size], "w-auto", className)}
    />
  );

  if (to) {
    return (
      <Link to={to} className="flex items-center gap-2">
        {logoElement}
      </Link>
    );
  }

  return logoElement;
}
