interface WindowSize { width: number; height: number; } /** * Hook that tracks the browser window dimensions and updates on resize. * * Automatically listens for window resize events and provides the current * width and height. Safe for SSR environments by checking for window availability. * * @returns An object containing: * - `width`: Current window inner width in pixels * - `height`: Current window inner height in pixels * * @example * ```tsx * function ResponsiveComponent() { * const { width, height } = useWindowSize(); * * return ( *
Window size: {width} x {height}
* {width < 768 ? ( *