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

export default function TestimonialCard({ question, answer, src, alt }) {
  const finalsrc = Boolean(src) ? src : "/images/logo.png";

  return (
    <div className="space-y-2">
      <div className="ring-2 ring-alice-werefox-blue-dark dark:ring-alice-werefox-blue">
        <p className="p-8 text-center text-lg sm:text-xl text-alice-werefox-blue-dark dark:text-alice-werefox-blue-light">
          {question}
        </p>
      </div>
      <div className=" ring-2 ring-alice-werefox-red-dark dark:ring-alice-werefox-red hover:ring-alice-werefox-blue-dark dark:hover:ring-alice-werefox-blue text-alice-werefox-red-dark dark:text-alice-werefox-red-light hover:text-alice-werefox-blue-dark dark:hover:text-alice-werefox-blue-light hover:animate-yip transition">
        <Link href="https://yiff.life/@werefox">
          <a target="_blank">
            <div className="p-2 flex">
              <div className="order-1 flex-shrink-0 relative inline sm:w-32 w-16 min-h-full items-center justify-center align-middle pt-4 pb-4 pl-4">
                <Image
                  src={finalsrc}
                  layout="fill"
                  objectFit="contain"
                  alt={alt}
                />
              </div>
              <div className="order-2 flex overflow-auto items-center justify-center animate-wiggle p-4 sm:text-lg text-xs text-center sm:min-h-full h-full">
                {answer}
                <br />
                {"- @alice"}
              </div>
            </div>
          </a>
        </Link>
      </div>
    </div>
  );
}
