// src/components/Header.jsx import React, { useEffect, useState } from 'react' import { healthCheck } from '../lib/api' const NAV_LINKS = [ { label: 'Dashboard', action: () => window.scrollTo({ top: 0, behavior: 'smooth' }) }, { label: 'Pipeline', action: () => document.getElementById('pipeline-section')?.scrollIntoView({ behavior: 'smooth' }) }, { label: 'Docs', action: () => window.open('http://localhost:8000/docs', '_blank') }, { label: 'GitHub', action: () => window.open('https://github.com/', '_blank') }, ] export default function Header() { const [apiStatus, setApiStatus] = useState('checking') const [activeNav, setActiveNav] = useState('Dashboard') useEffect(() => { healthCheck() .then(() => setApiStatus('online')) .catch(() => setApiStatus('offline')) }, []) const statusDot = { checking: 'bg-amber animate-pulse', online: 'bg-green', offline: 'bg-red', }[apiStatus] const statusLabel = { checking: 'Connecting…', online: 'API Online', offline: 'Demo Mode', }[apiStatus] return (
{/* Logo */}
{ setActiveNav('Dashboard'); window.scrollTo({ top: 0, behavior: 'smooth' }) }} >
EM
perceive_ai
MULTIMODAL EMOTIONAL INTELLIGENCE
{/* Center nav */} {/* Status */}
{statusLabel}
) }