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

const initialView = <></>

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

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

  return view
}

export default DesktopView
