UNPKG

@geneui/components

Version:

The Gene UI components library designed for BI tools

18 lines (15 loc) 509 B
import { a as clientConfigs, m as mobileScreenSize } from '../configs-00612ce0.js'; import useWindowSize from './useWindowSize.js'; import 'react'; import './useDebounce.js'; function useDeviceType(screenType) { const { width } = useWindowSize(); const type = screenType || (clientConfigs.isMobile ? clientConfigs.isMobile() ? 'mobile' : 'desktop' : width < mobileScreenSize ? 'mobile' : 'desktop'); return { type, isMobile: type === 'mobile' }; } export { useDeviceType as default };