AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.
HTML ai-agentcloudflarecloudflare-d1cloudflare-r2cloudflare-workersdockerelectronevernoteevernote-alternativeknowledge-basemcpnote-takingobsidian-alternativeoffline-firstpersonal-knowledge-basepwaself-hostedsqlitetiptapweb-clipper
import { useCallback, useState } from "react";
import { combineFontLoadStatus, type FontLoadStatus } from "./font-load-state";
export const useFontPreviewStatus = (key: string, contentStatus: FontLoadStatus) => {
const [preview, setPreview] = useState<{ key: string; status: FontLoadStatus }>({ key: "", status: "idle" });
const onPreviewStatus = useCallback((status: FontLoadStatus) => {
setPreview(current => current.key === key && current.status === status ? current : { key, status });
}, [key]);
return { onPreviewStatus, status: combineFontLoadStatus(contentStatus, preview.key === key ? preview.status : "loading") };
};