import { useState, useEffect } from 'react' export function useOrientation() { const [orientation, setOrientation] = useState<'portrait' | 'landscape'>('portrait') useEffect(() => { const updateOrientation = () => { setOrientation(window.innerWidth > window.innerHeight ? 'landscape' : 'portrait') } updateOrientation() window.addEventListener('resize', updateOrientation) return () => window.removeEventListener('resize', updateOrientation) }, []) return orientation }