In the process of creating my Next.js application, I have developed a page that is exclusively for mobile devices. My question is how can I ensure that this page is only accessible to users on mobile devices? In case someone tries to access it from a desktop, I'd like them to be redirected to the homepage or shown an error message instead.
/pages
index.js
mobile-only.js