import { Button, Heading, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, ModalOverlay, Stack, Text, useDisclosure, VStack, } from "@chakra-ui/react"; import { FC, ReactNode, useEffect, useState } from "react"; const AdDetector: FC<{ children: ReactNode }> = ({ children }) => { const [adBlockEnabled, setAdBlockEnabled] = useState(false); const { isOpen, onOpen, onClose } = useDisclosure(); const [joke, setJoke] = useState>({}); useEffect(() => { (async () => { const googleAdUrl = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"; try { await fetch(new Request(googleAdUrl)); } catch (e) { setAdBlockEnabled(true); setJoke( await ( await fetch( "https://v2.jokeapi.dev/joke/Any?blacklistFlags=racist,sexist" ) ).json() ); onOpen(); } })(); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( <> Support the Creatorđź’š

Open source developers work really hard to provide the best, secure & efficient software experience for you & people all around the world. Most of the time we work without any wages at all but we need minimum support to live & these Ads Helps Us earn the minimum wage that we need to live.{" "} So, please support Spotube by disabling the AdBlocker on this page or by sponsoring or donating to our collectives directly

{!adBlockEnabled ? ( children ) : ( Here's something interesting: {joke.joke ?? ( <>

{joke.setup}

{joke.delivery}

)}
Be grateful for all the favors you get. But don't let it become a pile of debt. Try returning them as soon as you can. You'll feel relieved - Kingkor Roy Tirtho
)} ); }; export default AdDetector;