Detect when the user has not interacted with the page for a while.
This is custom React hooks, you need to follow the Basic Rules when you use it.
Stay still for three seconds.
const useIdle = (
timeout: number,
options?: { events?: string[]; initialState?: boolean },
) => boolean