'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { SidebarMenuItem, SidebarMenuButton } from '../../ui/sidebar';
import { ElapsedTime } from '../../common/elapsed-time';
import { featureStatusConfig } from '../../common/feature-status-config';
export function FeatureListItem({ name, status, startedAt, duration, onClick, }) {
    const { icon: StatusIcon, iconClass } = featureStatusConfig[status];
    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] }) }));
}
