The usePageVisibility hook allows you to detect when the page visibility changes, enabling you to execute a callback function based on whether the page is hidden or visible.
callback: A function that will be called with a boolean argument indicating whether the page is hidden or visible. This function can also return a promise.