'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import Link from 'next/link';
import { useTranslation } from 'react-i18next';
import { Bot, ArrowRight, Sparkles } from 'lucide-react';
import { Badge } from '../ui/badge.js';
export function AgentList({ agents }) {
    const { t } = useTranslation('web');
    if (agents.length === 0) {
        return (_jsxs("div", { className: "bg-muted/30 rounded-lg border border-dashed p-6", children: [_jsx("p", { className: "text-sm font-medium", children: t('agentEditor.noAgentsRegistered') }), _jsxs("p", { className: "text-muted-foreground text-sm", children: [t('agentEditor.emptyRegistryPrefix'), _jsx("code", { className: "bg-muted mx-1 rounded px-1 py-0.5 text-xs", children: "builtin-prompt-registry.ts" }), t('agentEditor.emptyRegistrySuffix')] })] }));
    }
    return (_jsx("ul", { className: "flex flex-col divide-y rounded-lg border", "data-testid": "agent-list", children: agents.map((agent) => (_jsxs("li", { className: "flex items-center gap-3 px-3 py-2", "data-testid": `agent-row-${agent.agentType}`, children: [_jsx("div", { className: "bg-primary/10 text-primary flex h-8 w-8 items-center justify-center rounded-md", children: agent.isCustom ? (_jsx(Sparkles, { className: "size-4", "aria-hidden": true })) : (_jsx(Bot, { className: "size-4", "aria-hidden": true })) }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("p", { className: "truncate text-sm font-medium", children: agent.displayName ?? agent.agentType }), agent.isCustom ? (_jsx(Badge, { variant: "secondary", className: "shrink-0", children: t('agentEditor.custom') })) : null] }), _jsxs("p", { className: "text-muted-foreground text-xs", children: [agent.isCustom ? agent.agentType : null, agent.isCustom ? ' · ' : '', t('agentEditor.promptCount', { count: agent.promptCount }), agent.overrideCount > 0
                                    ? ` · ${t('agentEditor.overrideCount', { count: agent.overrideCount })}`
                                    : ''] })] }), _jsxs(Link, { href: `/agents/${agent.agentType}`, className: "text-primary inline-flex shrink-0 items-center gap-1 text-xs hover:underline", children: [t('agentEditor.edit'), _jsx(ArrowRight, { className: "size-3" })] })] }, agent.agentType))) }));
}
