import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Wand2 } from "lucide-react";
import { Popover, PopoverContent, PopoverTrigger, } from "../../../../components/ui/popover";
export function AgentPredefinedPromptsButton({ prompts, open, onOpenChange, onSelectPrompt, }) {
    if (!prompts?.length) {
        return null;
    }
    return (_jsxs(Popover, { open: open, onOpenChange: onOpenChange, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { className: "hover:bg-neutral-grey-10 rounded p-1", title: "Predefined prompts", "aria-label": "Predefined prompts", type: "button", children: _jsx(Wand2, { className: "h-3 w-3", strokeWidth: 1 }) }) }), _jsx(PopoverContent, { className: "w-64 p-0", align: "start", children: _jsx("div", { className: "max-h-56 overflow-y-auto p-2", children: prompts.map((prompt, index) => (_jsx("div", { className: "text-neutral-grey-100 hover:bg-neutral-grey-10 cursor-pointer rounded p-1.5 text-[10px]", onClick: () => onSelectPrompt(prompt.prompt), children: prompt.title }, `${prompt.title}-${index}`))) }) })] }));
}
//# sourceMappingURL=AgentPredefinedPromptsButton.js.map