SPB Git

spb/ai-atlas

Public
410 B · 13 lines tsx
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
Files · 9f1db171c786cf4a3b99436329f29b145c02aeec
Menu

Theme