import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { ChevronDown, ChevronUp } from "lucide-react";
import { AgentCard } from "./AgentCard";
import { SecretAgentIcon } from "../editor/ui/Icons";
import { sanitizeSvg } from "../lib/sanitize";
export function ProfileAgentsGroup({ profileGroup, isExpanded, isLoadingMore, hasMore, onToggle, onLoadMore, onAgentClick, onResumeAgent, onCloseAgent, onDeleteAgent, formatDateTime, selectedAgentId, }) {
    return (_jsxs("div", { className: "overflow-hidden rounded-xl border border-gray-100 bg-white shadow-[0_1px_2px_rgba(0,0,0,0.02)]", children: [_jsxs("button", { onClick: onToggle, className: "flex w-full items-center gap-4 bg-[#fcfcfc] p-4 text-left transition-all hover:bg-gray-50 group", children: [_jsx("div", { className: "shrink-0", children: _jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-lg bg-white ring-1 ring-gray-100 shadow-sm transition-transform group-hover:scale-105", children: profileGroup.profileSvgIcon ? (_jsx("div", { className: "h-6 w-6 text-gray-500 [&>svg]:h-full [&>svg]:w-full flex items-center justify-center", dangerouslySetInnerHTML: {
                                    __html: sanitizeSvg(profileGroup.profileSvgIcon),
                                } })) : (_jsx(SecretAgentIcon, { size: 24, strokeWidth: 2, className: "text-gray-400" })) }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("h3", { className: "text-[15px] font-semibold tracking-tight text-gray-900", children: profileGroup.profileName }), _jsxs("p", { className: "text-[12px] font-medium text-gray-400", children: [profileGroup.totalClosedCount, " closed agent", profileGroup.totalClosedCount !== 1 ? "s" : ""] })] }), _jsx("div", { className: "shrink-0 text-gray-400 transition-colors hover:text-gray-600", children: isExpanded ? (_jsx(ChevronUp, { className: "size-5", strokeWidth: 2 })) : (_jsx(ChevronDown, { className: "size-5", strokeWidth: 2 })) })] }), isExpanded && (_jsxs("div", { className: "space-y-3 bg-[#fcfcfc]/30 p-4 border-t border-gray-50", children: [profileGroup.agents.map((agent) => (_jsx(AgentCard, { agent: agent, onClick: onAgentClick, onResume: onResumeAgent, onClose: onCloseAgent, onDelete: onDeleteAgent, formatDateTime: formatDateTime, selected: selectedAgentId === agent.id }, agent.id))), hasMore && (_jsx("div", { className: "flex justify-center pt-2", children: _jsx("button", { onClick: (e) => {
                                e.stopPropagation();
                                onLoadMore();
                            }, disabled: isLoadingMore, className: "rounded-full border border-gray-200 bg-white px-8 py-2 text-[13px] font-semibold tracking-tight text-gray-600 transition-all hover:bg-gray-50 hover:text-gray-900 hover:shadow-sm disabled:opacity-50", children: isLoadingMore ? "Loading..." : "Load More" }) }))] }))] }));
}
//# sourceMappingURL=ProfileAgentsGroup.js.map