import dynamic from 'next/dynamic'
import BasicFooter from '../elements/Footer/BasicFooter'
import Image from 'next/image'
import whatsappUrl from '@/core/utils/whatsappUrl'

const Navbar = dynamic(() => import('../elements/Navbar/Navbar'))
const AnimationLayout = dynamic(() => import('./AnimationLayout'))

const BasicLayout = ({ children }) => {
  return (
    <>
      <Navbar />
      <AnimationLayout>
        {children}
        <div className='fixed bottom-4 right-4 sm:bottom-14 sm:right-10 z-50'>
          <a
            href={whatsappUrl(null)}
            className='py-2 pl-3 pr-4 rounded-full bg-[#4FB84A] border border-green-300 flex items-center'
          >
            <Image
              src='/images/socials/WHATSAPP.svg'
              alt='Whatsapp'
              className='block sm:hidden'
              width={36}
              height={36}
            />
            <Image
              src='/images/socials/WHATSAPP.svg'
              alt='Whatsapp'
              className='hidden sm:block'
              width={44}
              height={44}
            />
            <span className='text-white font-bold ml-1.5'>Whatsapp</span>
          </a>
        </div>
      </AnimationLayout>
      <BasicFooter />
    </>
  )
}

export default BasicLayout
