import { useEffect , useState } from "react" ; export const useIsMobile = ( ) => { const [ isMobile , setIsMobile ] = useState ( false ) ; useEffect ( ( ) => { setIsMobile ( window . innerWidth < 768 ) ; } , [ ] ) ; return isMobile ; } ;