import * as React from "react";
import { cn } from "@/lib/utils";

export type AuthLogoProps = {
  logoUrl?: string;
  wealthxLogoUrl?: string;
  className?: string;
};

export function AuthLogo({
  logoUrl,
  wealthxLogoUrl,
  className,
}: AuthLogoProps) {
  const wealthxMark = wealthxLogoUrl ? (
    <img src={wealthxLogoUrl} alt="WealthX" className="h-5 w-auto" />
  ) : (
    <span className="text-sm font-semibold tracking-tight text-foreground">
      WealthX
    </span>
  );

  if (!logoUrl) {
    return (
      <div className={cn("flex items-center justify-center", className)}>
        {wealthxLogoUrl ? (
          <img src={wealthxLogoUrl} alt="WealthX" className="h-8 w-auto" />
        ) : (
          <span className="text-lg font-semibold tracking-tight text-foreground">
            WealthX
          </span>
        )}
      </div>
    );
  }

  return (
    <div className={cn("flex items-center gap-3", className)}>
      <img
        src={logoUrl}
        alt="Partner logo"
        className="h-8 w-auto object-contain"
      />
      <div className="flex items-center gap-1.5">
        <span className="text-xs text-muted-foreground">Powered by</span>
        {wealthxMark}
      </div>
    </div>
  );
}
