const isMobile = {
  Android: () => navigator.userAgent.match(/Android/i),
  iOS: () => navigator.userAgent.match(/iPhone|iPad|iPod/i),
};

export const redirectToApp = navigate => {
  if (isMobile.iOS())
    window.location.replace(import.meta.env.VITE_APPSTORE_URL);
  else if (isMobile.Android())
    window.location.replace(import.meta.env.VITE_GOOGLE_PLAY_URL);
  else navigate('/');
};
