import {PixelRatio, Platform} from 'react-native'

export const IS_IOS = Platform.OS === 'ios'
export const IS_ANDROID = Platform.OS === 'android'
export const IS_NATIVE = IS_IOS || IS_ANDROID
export const IS_WEB = Platform.OS === 'web'
export const IS_DEV = __DEV__
export const IS_E2E = process.env.EXPO_PUBLIC_ENV === 'e2e'
// e2e always logs in via the in-app dev shortcut; dev opts in explicitly
export const SKIP_MAGIC_LINK =
  IS_E2E ||
  (IS_DEV && process.env.EXPO_PUBLIC_SKIP_MAGIC_LINK === 'true')
export const IS_HIGH_DPI = PixelRatio.get() >= 2

const iOSMajorVersion =
  IS_IOS && typeof Platform.Version === 'string'
    ? parseInt(Platform.Version.split('.')[0] ?? '0', 10)
    : 0

export const IS_LIQUID_GLASS = iOSMajorVersion >= 26
