"use client"; import { useEffect } from "react"; import { accountRequest } from "@/lib/account-client"; import { useUser } from "@/lib/use-user"; // Counts a signed-in user's visit to a tutorial (tutorial_activity), part of their usage profile. Renders nothing. export function RecordTutorialView({ tutorialKey }: { tutorialKey: string }) { const { user } = useUser(); const userId = user?.id; useEffect(() => { if (!userId) return; accountRequest("view", { key: tutorialKey }).then(({ error }) => { if (error) console.error("Failed to record tutorial view:", error); }); }, [userId, tutorialKey]); return null; }