'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { SidebarMenuItem, SidebarMenuButton } from '../../ui/sidebar.js';
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../ui/tooltip.js';
import { ElapsedTime } from '../../common/elapsed-time/index.js';
import { featureStatusConfig } from '../../common/feature-status-config.js';
import { getAgentTypeIcon, agentTypeLabels, } from '../../common/feature-node/agent-type-icons.js';
import { getModelMeta } from '../../../lib/model-metadata.js';
export function FeatureListItem({ name, status, startedAt, duration, agentType, modelId, onClick, }) {
    const { icon: StatusIcon, iconClass } = featureStatusConfig[status];
    const AgentIcon = agentType ? getAgentTypeIcon(agentType) : null;
    return (_jsx(SidebarMenuItem, { "data-testid": "feature-list-item", children: _jsxs(SidebarMenuButton, { size: "sm", onClick: onClick, tooltip: name, className: "cursor-pointer", children: [_jsx(StatusIcon, { className: iconClass }), _jsx("span", { className: "flex-1 truncate font-medium", children: name }), status === 'in-progress' && startedAt != null ? (_jsx("span", { "data-testid": "feature-list-item-meta", className: "text-muted-foreground ml-auto text-xs tabular-nums", children: _jsx(ElapsedTime, { startedAt: startedAt }) })) : null, status === 'done' && duration ? (_jsx("span", { "data-testid": "feature-list-item-meta", className: "text-muted-foreground ml-auto text-xs tabular-nums", children: duration })) : null, AgentIcon ? (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("span", { className: "ml-auto shrink-0", children: _jsx(AgentIcon, { className: "h-3.5 w-3.5" }) }) }), _jsxs(TooltipContent, { side: "right", children: [_jsx("span", { className: "font-medium", children: agentTypeLabels[agentType] ?? agentType }), modelId ? (_jsxs("span", { className: "ms-1 opacity-70", children: ["\u00B7 ", getModelMeta(modelId).displayName || modelId] })) : null] })] }) })) : null] }) }));
}
