Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
ts 23 lines 630 Bytes
Raw
1 "use client";
2
3 import { useEffect, useState } from "react";
4
5 const MOBILE_QUERY = "(max-width: 767px)";
6
7 /**
8 * Reactive mobile breakpoint hook (matches Tailwind's `md:` at 768px).
9 * Ported from landing-new alongside the hero.
10 */
11 export function useIsMobile(): boolean {
12 const [isMobile, setIsMobile] = useState(false);
13
14 useEffect(() => {
15 const mq = window.matchMedia(MOBILE_QUERY);
16 setIsMobile(mq.matches);
17 const handler = (e: MediaQueryListEvent) => setIsMobile(e.matches);
18 mq.addEventListener("change", handler);
19 return () => mq.removeEventListener("change", handler);
20 }, []);
21
22 return isMobile;
23 }