diff --git a/app/components/ads/bottom.jsx b/app/components/ads/bottom.jsx new file mode 100755 index 0000000..e361ce8 --- /dev/null +++ b/app/components/ads/bottom.jsx @@ -0,0 +1,101 @@ +"use client"; +import React, { useEffect, useState } from "react"; +import { FaChevronUp, FaChevronDown } from "react-icons/fa"; + +const BottomAd = () => { + const [isClient, setIsClient] = useState(false); + const [minimized, setMinimized] = useState(false); + + useEffect(() => { + setIsClient(true); + + if (typeof window !== "undefined") { + // Load AdSense script once + const scriptId = "adsbygoogle-js"; + if (!document.getElementById(scriptId)) { + const script = document.createElement("script"); + script.id = scriptId; + script.async = true; + script.src = + "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4311738896428559"; + script.crossOrigin = "anonymous"; + document.head.appendChild(script); + } + } + }, []); + + useEffect(() => { + if (isClient) { + try { + (window.adsbygoogle = window.adsbygoogle || []).push({}); + } catch (e) { + console.warn("AdSense error:", e); + } + } + }, [isClient]); + + if (!isClient) return null; + + // Detect environment for test ads + const isDev = + window.location.hostname === "localhost" || + window.location.hostname === "127.0.0.1"; + + return ( +