import { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import { agentApi } from '../utils/api'; function Home() { const [stats, setStats] = useState({ agents: [], agentCount: 0, actions: 0, connectors: 0, status: {}, }); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); // Fetch dashboard data useEffect(() => { const fetchData = async () => { setLoading(true); try { const agents = await agentApi.getAgents(); setStats({ agents: agents.agents || [], agentCount: agents.agentCount || 0, actions: agents.actions || 0, connectors: agents.connectors || 0, status: agents.statuses || {}, }); } catch (err) { console.error('Error fetching dashboard data:', err); setError('Failed to load dashboard data'); } finally { setLoading(false); } }; fetchData(); }, []); if (loading) { return
Loading dashboard data...
; } if (error) { return
{error}
; } return (
LocalAgent Logo

LocalAgent

{/* Dashboard Stats */}
{stats.actions}
Available Actions
{stats.connectors}
Available Connectors
{stats.agentCount}
Agents
{/* Cards Container */}
{/* Card for Agent List Page */}

Agent List

View and manage your list of agents, including detailed profiles and statistics.

{/* Card for Create Agent */}

Create Agent

Create a new intelligent agent with custom behaviors, connectors, and actions.

{/* Card for Actions Playground */}

Actions Playground

Explore and test available actions for your agents.

{/* Card for Group Create */}

Create Group

Create agent groups for collaborative intelligence.

{stats.agents.length > 0 && (

Your Agents

{stats.agents.map((agent) => (
{stats.status[agent] ? 'Active' : 'Paused'}

{agent}

Chat Settings Status
))}
)}
); } export default Home;