import { WhatsAppIcon } from "./icons";

const WHATSAPP_NUMBER = "918479073929";
const WHATSAPP_MESSAGE = "Hi VehCall! I'd like to know more about your service.";

export default function WhatsAppFloatButton() {
  return (
    <a
      href={`https://wa.me/${WHATSAPP_NUMBER}?text=${encodeURIComponent(
        WHATSAPP_MESSAGE
      )}`}
      target="_blank"
      rel="noopener noreferrer"
      aria-label="Chat with VehCall on WhatsApp"
      className="group fixed bottom-24 right-5 z-40 flex h-14 w-14 items-center justify-center rounded-full bg-success text-white shadow-[0_10px_30px_-6px_rgba(37,211,102,0.6)] transition-transform hover:scale-105 md:bottom-6"
    >
      <span className="absolute inset-0 rounded-full bg-success opacity-40 animate-ping" />
      <WhatsAppIcon width={28} height={28} className="relative" />
      <span className="pointer-events-none absolute right-full mr-3 hidden whitespace-nowrap rounded-lg bg-panel px-3 py-1.5 text-sm font-medium text-white opacity-0 shadow-lg transition-opacity group-hover:opacity-100 md:block">
        Chat on WhatsApp
      </span>
    </a>
  );
}
