import Link from "next/link";
import Image from "next/image";

export default function SupportButton({ title, alt, src, url }) {
  const emptyTitle = title ? true : false;
  if (emptyTitle) {
    return (
      <div className="w-full justify-center flex">
        <Link href={url}>
          <a target="_blank">
            <p className="rounded-lg pt-2 pb-2 pl-4 pr-4 w-full w-max-60 ring-2 ring-werefox-grey dark:ring-werefox-grey-darker text-lg text-center text-werefox-grey-darker dark:text-werefox-grey-lightest bg-werefox-blue dark:bg-werefox-blue-dark transition hover:bg-werefox-blue-light dark:hover:bg-werefox-blue-darker">
              <span className="inline-block h-6">
                <img alt={alt} src={src} className="inline-block h-6"></img>
              </span>{" "}
              {title}
            </p>
          </a>
        </Link>
      </div>
    );
  } else {
    return (
      <div className="w-full justify-center flex">
        <Link href={url}>
          <a
            target="_blank"
            className="rounded-lg ring-2 ring-werefox-grey dark:ring-werefox-grey-darker"
          >
            <img
              alt={alt}
              src={src}
              className="inline-flex h-10 filter transition hover:brightness-125"
            />
          </a>
        </Link>
      </div>
    );
  }
}
