diff --git a/AppImage/hooks/use-mobile.tsx b/AppImage/hooks/use-mobile.tsx new file mode 100644 index 0000000..5362201 --- /dev/null +++ b/AppImage/hooks/use-mobile.tsx @@ -0,0 +1,23 @@ +"use client" + +import { useEffect, useState } from "react" + +export function useIsMobile() { + const [isMobile, setIsMobile] = useState(false) + + useEffect(() => { + const checkMobile = () => { + setIsMobile(window.innerWidth < 768) + } + + // Check on mount + checkMobile() + + // Listen for resize + window.addEventListener("resize", checkMobile) + + return () => window.removeEventListener("resize", checkMobile) + }, []) + + return isMobile +}