/** Who built the system, as in V1. The values come from .env; without a name nothing is shown. */
const NAME = import.meta.env["VITE_DEV_FOOTER_NAME"] as string | undefined;
const URL = import.meta.env["VITE_DEV_FOOTER_URL"] as string | undefined;
const EMAIL = import.meta.env["VITE_DEV_FOOTER_EMAIL"] as string | undefined;

export function DeveloperFooter({ className }: { className?: string }) {
  if (!NAME) return null;
  return (
    <footer className={className}>
      <p className="flex flex-wrap gap-x-2 gap-y-1 text-[12px] text-muted-foreground">
        <span>Developer</span>
        {URL ? (
          <a
            className="text-primary hover:underline"
            href={URL}
            target="_blank"
            rel="author noreferrer"
          >
            {NAME}
          </a>
        ) : (
          <span className="text-foreground">{NAME}</span>
        )}
        {EMAIL && (
          <a className="text-primary hover:underline" href={`mailto:${EMAIL}`}>
            {EMAIL}
          </a>
        )}
      </p>
    </footer>
  );
}
