import { useMediaQuery } from 'react-responsive';
import { UseDetectDeviceType } from './types.d';

export const useDetectDevice = (): UseDetectDeviceType => {
  const isDesktop = useMediaQuery({ minWidth: 992 });

  const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 });

  const isMobile = useMediaQuery({ maxWidth: 767 });

  const isNotMobile = useMediaQuery({ minWidth: 768 });

  const isLandscape = useMediaQuery({ query: '(orientation: landscape)' });

  return { isDesktop, isTablet, isMobile, isNotMobile, isLandscape };
};
