import { isTauri } from '../mock-tauri'

export const MACOS_TRAFFIC_LIGHT_SAFE_PADDING = 90

function getUserAgent(): string {
  if (typeof navigator === 'undefined') return ''
  return navigator.userAgent
}

export function isLinux(): boolean {
  const userAgent = getUserAgent()
  return userAgent.includes('Linux') && !userAgent.includes('Android')
}

export function isMac(): boolean {
  const userAgent = getUserAgent()
  return userAgent.includes('Mac OS X') || userAgent.includes('Macintosh')
}

export function isWindows(): boolean {
  return getUserAgent().includes('Windows')
}

export function shouldUseCustomWindowChrome(): boolean {
  return isTauri() && (isLinux() || isWindows())
}
