'use client' import { useEffect, useState } from 'react' import { Sidebar } from '@/components/sidebar' import { api, type Integration, type Stats } from '@/lib/api' import { Activity, Plug, Zap, CheckCircle, Clock } from 'lucide-react' export default function DashboardPage() { const [integrations, setIntegrations] = useState([]) const [stats, setStats] = useState(null) const [loading, setLoading] = useState(true) useEffect(() => { Promise.all([ api.get('/api/apps').catch(() => []), api.get('/api/analytics/overview').catch(() => null), ]).then(([apps, s]) => { setIntegrations(apps) setStats(s) setLoading(false) }) }, []) const metrics = [ { label: 'Total Executions', value: stats?.total_executions ?? 0, icon: Activity, color: 'text-accent-cyan' }, { label: 'Integrations', value: integrations.length, icon: Plug, color: 'text-accent-green' }, { label: 'Success Rate', value: `${stats?.success_rate ?? 100}%`, icon: CheckCircle, color: 'text-accent-blue' }, { label: 'Avg Latency', value: `${stats?.avg_latency_ms ?? 0}ms`, icon: Clock, color: 'text-accent-amber' }, ] return (

Dashboard

{metrics.map((m) => (

{m.label}

{loading ? '...' : m.value}

))}

Quick Connect

{loading ? (

Loading...

) : integrations.length === 0 ? (

No integrations yet

Set COMPOSIO_API_KEY to sync all 1000+ tools

) : (
{integrations.slice(0, 8).map((i) => (
{i.name} (e.currentTarget.style.display = 'none')} />

{i.name}

{i.category}

{i.tool_count} tools {i.auth_type}
))}
)}
) }