'use client'
import { useGetAbout } from '@/app/[name]/(Main)/about/hooks/useAboutData'
import React, { useEffect } from 'react'

const ActiveChecker = () => {

    const { data } = useGetAbout()

    useEffect(() => {

        if (data?.data && !data?.data?.isActive) {
            document.body.style.overflow = 'hidden'
        } else {
            document.body.style.overflow = 'auto'

        }

    }, [data?.data])


    if (data?.data && !data?.data?.isActive)
        return (
            <div className='fixed top-0 size-full bg-black/60 z-999999999 flex justify-center items-center text-white! text-lg font-bold backdrop-blur-sm'>
                <div>فروشگاه غیرفعال است.</div>
            </div>
        )
}

export default ActiveChecker