"use client";
import Link from "next/link";
import { useEffect, useState } from "react";
import { FaWhatsapp } from "react-icons/fa";
export default function HeaderWhatsApp({ community_name }) {
  const [currentURL, setCurrentURL] = useState("");
  useEffect(() => {
    setCurrentURL(window.location.href);
  }, []);
  return (
    <>
      <Link
        href={`https://wa.me/971524474422?text=Hi+There%2C+I%27m+interested+in+${community_name}+Kindly+send+me+more+information.+Thank+you%21+${currentURL}&type=phone_number&app_absent=0`}
      >
        <div className="contact-info justify-content-end">
          <FaWhatsapp />
          <div className="contact-text">
            <p className="p">24 Hour Helpline</p>
            <p>+971524474422</p>
          </div>
        </div>
      </Link>
    </>
  );
}
