import React from 'react'; import { useTranslation } from 'react-i18next'; import { useAgents } from '@/api/automation'; import { Card } from '@/components/ui/Card'; import { Badge } from '@/components/ui/Badge'; import { Skeleton } from '@/components/ui/Skeleton'; import { EmptyState } from '@/components/ui/EmptyState'; import { Bot, Brain, Activity, AlertCircle } from 'lucide-react'; import type { AgentDefinition } from '@/types/automation'; function statusBadgeVariant(status: string): 'success' | 'warning' | 'secondary' { if (status === 'active') return 'success'; if (status === 'inactive') return 'secondary'; return 'warning'; } export function AgentsOverviewPage() { const { t } = useTranslation(); const { data: agents, isLoading, isError, refetch } = useAgents(); return (

{t('agentsOverview.agentenübersicht')}

{t('agentsOverview.verwaltensiekiagentenführensie')}

{/* Loading */} {isLoading && (
{[1, 2, 3].map((i) => ( ))}
)} {/* Error */} {isError && (
{t('common.errorLoading')}
)} {/* Empty State */} {!isLoading && !isError && (!agents || agents.length === 0) && ( } /> )} {/* Agent List */} {!isLoading && !isError && agents && agents.length > 0 && (
{agents.map((agent: AgentDefinition) => (

{agent.name}

{agent.active ? t('agent.active', 'Aktiv') : t('agent.inactive', 'Inaktiv')} {agent.mode}
{agent.description && (

{agent.description}

)}
{agent.model} {agent.tools?.length || 0} tools
))}
)}
); }