SPB Git forge

spb/ai-atlas

Public
41commits 1branches 0releases
4.6 MBsize
maindefault branch
12 days agolast push
HTML 77.2% TypeScript 10.5% Python 9.6% JavaScript 2.5%
410 B · 13 lines tsx
Raw Blame History
1'use client';2import { useEffect } from 'react';3import { clientApi } from '@/lib/client-api';45/** Fire-and-forget page-view beacon (POST /views { path }) once per entity page mount. Renders nothing. */6export function ViewBeacon({ path }: { path: string }) {7  useEffect(() => {8    const t = setTimeout(() => void clientApi.view(path), 800);9    return () => clearTimeout(t);10  }, [path]);11  return null;12}13