'use client'; import { useEffect, useState } from 'react'; import { checkHealth } from '@/lib/api'; import { Shield } from 'lucide-react'; export default function PortalHeader() { const [nodeStatus, setNodeStatus] = useState<'online' | 'offline' | 'checking'>('checking'); const [nodeVersion, setNodeVersion] = useState(''); useEffect(() => { let mounted = true; async function poll() { try { const h = await checkHealth(); if (!mounted) return; setNodeStatus('online'); setNodeVersion(h.node); } catch { if (!mounted) return; setNodeStatus('offline'); } } poll(); const iv = setInterval(poll, 30_000); return () => { mounted = false; clearInterval(iv); }; }, []); return (
{/* Page title slot — parent fills with children */}
{/* Right side */}
{/* Node status */}
{nodeStatus === 'online' ? `Node ${nodeVersion}` : 'Offline'}
{/* Wallet badge placeholder */}
Wallet Connected
); }