import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useState } from "react";
import { History } from "lucide-react";
import { Button } from "../../../../components/ui/button";
import { Popover, PopoverContent, PopoverTrigger, } from "../../../../components/ui/popover";
import { AgentEditOperationsPanel } from "./EditOperationsPanel";
export function AgentEditHistoryButton({ operations, }) {
    const [open, setOpen] = useState(false);
    const [actionsEl, setActionsEl] = useState(null);
    return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { size: "xs", variant: "ghost", className: "text-neutral-grey-100 hover:bg-neutral-grey-10! h-8 rounded-md bg-transparent! px-3 text-[12px] font-normal shadow-none! hover:shadow-none!", "data-testid": "agent-edit-history-trigger", children: [_jsx(History, { className: "mr-1.5 h-4 w-4", strokeWidth: 1 }), "Edit history"] }) }), _jsxs(PopoverContent, { align: "end", side: "top", sideOffset: 6, className: "w-[420px] max-w-[90vw] p-0", children: [_jsxs("div", { className: "border-border-default flex items-center justify-between gap-2 border-b px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(History, { className: "text-neutral-grey-50 h-3.5 w-3.5", strokeWidth: 1 }), _jsx("span", { className: "text-neutral-grey-100 text-xs font-medium", children: "Edit History" })] }), _jsx("div", { ref: setActionsEl, className: "flex items-center gap-1" })] }), _jsx("div", { className: "max-h-[60vh] overflow-y-auto", children: _jsx(AgentEditOperationsPanel, { operations: operations, headerless: true, headerActionsContainer: actionsEl }) })] })] }));
}
//# sourceMappingURL=AgentEditHistoryButton.js.map