9 lines
242 B
TypeScript
9 lines
242 B
TypeScript
|
import { UAParser } from 'ua-parser-js'
|
||
|
|
||
|
const parser = new UAParser(window.navigator.userAgent)
|
||
|
const { type } = parser.getDevice()
|
||
|
|
||
|
export const userAgent = parser.getResult()
|
||
|
|
||
|
export const isMobile = type === 'mobile' || type === 'tablet'
|