summaryrefslogtreecommitdiff
path: root/src/core/components/views/DesktopView.jsx
blob: 9042a7664c18a474493a2f59d9b33714375e9fe6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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