import { useEffect } from "react";

const FacebookWidget = () => {
  useEffect(() => {
    if (typeof window !== "undefined") {
      const script = document.createElement("script");
      script.src = "https://embedsocial.com/cdn/ht.js";
      script.async = true;
      document.head.appendChild(script);

      return () => {
        document.head.removeChild(script);
      };
    }
  }, []);

  return (
    // <div
    //   className="embedsocial-hashtag rounded-md"
    //   data-ref="7501cb8270327e936909c6ed57298ead0c5c07d0"
    // ></div>
    <iframe
      name="f3d8479283c8374"
      width="1080px"
      height="480px"
      data-testid="fb:page Facebook Social Plugin"
      title="fb:page Facebook Social Plugin"
      scrolling="no"
      allow="encrypted-media"
      src="https://web.facebook.com/v12.0/plugins/page.php?adapt_container_width=true&amp;app_id=664876294862028&amp;channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df23357a43cf8c%26domain%3Dhumas.polri.go.id%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fhumas.polri.go.id%252Ff29b91925fa28f%26relation%3Dparent.parent&amp;container_width=280&amp;height=2080&amp;hide_cover=true&amp;href=https%3A%2F%2Fwww.facebook.com%2FDivHumasPolri&amp;locale=id_ID&amp;sdk=joey&amp;show_facepile=false&amp;small_header=false&amp;tabs=timeline&amp;width=280"
      style={{
        border: "none",
        visibility: "visible",
        width: "100%",
        height: "588px",
        borderRadius: "15px",
      }}
    ></iframe>
  );
};

export default FacebookWidget;
