'use client'; import { useCallback, useEffect, useState } from 'react'; import { api } from '@/lib/api'; import type { Project } from '@/lib/types'; import { ProjectCard } from '@/components/projects/project-card'; export default function ProjectsPage(): React.ReactElement { const [projects, setProjects] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { api('/api/projects') .then(setProjects) .catch(() => {}) .finally(() => setLoading(false)); }, []); const handleProjectClick = useCallback((project: Project) => { console.log('Project clicked:', project.id); }, []); return (

Projects

{loading ? (

Loading projects...

) : projects.length === 0 ? (

No projects yet

Projects will appear here when created via the gateway API

) : (
{projects.map((project) => ( ))}
)} {/* Mission status section */}
); } function MissionStatus(): React.ReactElement { const [mission, setMission] = useState | null>(null); const [loading, setLoading] = useState(true); useEffect(() => { api>('/api/coord/status') .then(setMission) .catch(() => setMission(null)) .finally(() => setLoading(false)); }, []); return (

Active Mission

{loading ? (

Loading mission status...

) : !mission ? (

No active mission detected

) : (
)}
); } function StatCard({ label, value }: { label: string; value: string }): React.ReactElement { return (

{label}

{value}

); }