'use client'; import { apiFetch } from '@/lib/api'; import Link from 'next/link'; import { useEffect, useState } from 'react'; /** * Marketing-header CTAs that reflect the session: a logged-in visitor sees a * "Dashboard" link instead of the sign-in buttons. The session cookie is * httpOnly, so login state is probed via /v1/auth/me. */ export function MarketingAuthButtons() { const [authed, setAuthed] = useState(null); useEffect(() => { apiFetch('/v1/auth/me') .then(() => setAuthed(true)) .catch(() => setAuthed(false)); }, []); if (authed) { return ( Dashboard ); } // Logged out — or still resolving — show the default sign-in CTAs. return ( <> Sign in Start building ); }