Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
import { useEffect, useState } from "react";
function pageIsVisible(): boolean {
return typeof document === "undefined" || document.visibilityState !== "hidden";
}
export function usePageVisibility(): boolean {
const [visible, setVisible] = useState(pageIsVisible);
useEffect(() => {
const update = () => setVisible(pageIsVisible());
document.addEventListener("visibilitychange", update);
return () => document.removeEventListener("visibilitychange", update);
}, []);
return visible;
}