import useDevice from '@/core/hooks/useDevice'
import { useEffect, useState } from 'react'

const DesktopView = ({ children }) => {
  const { isDesktop } = useDevice()
  const [view, setView] = useState(<></>)

  useEffect(() => {
    if (isDesktop) {
      setView(children)
    } else {
      setView(<></>)
    }
  }, [isDesktop, children])

  return view
}

export default DesktopView
