import { jsx } from "react/jsx-runtime";
import { useLingui } from "@lingui/react";
import react from "react";
import { useChatService } from "../../providers/chat-service.provider.js";
import { usePicker } from "../../providers/picker-provider.js";
import { DropdownPicker } from "../common/dropdown-picker.js";
function AutopilotChatAgentModeSelectorComponent({ useIcon }) {
    const { _ } = useLingui();
    const chatService = useChatService();
    const { agentModes, selectedAgentMode } = usePicker();
    const handleAgentModeSelect = react.useCallback((option)=>{
        chatService?.setAgentMode(option.id);
    }, [
        chatService
    ]);
    if (!agentModes || agentModes?.length === 0 || !selectedAgentMode) return null;
    return /*#__PURE__*/ jsx(DropdownPicker, {
        options: agentModes,
        selectedOption: selectedAgentMode,
        onSelect: handleAgentModeSelect,
        useIcon: useIcon,
        ariaLabel: _({
            id: 'autopilot-chat.input.agent-mode-selection-label'
        }),
        chatServiceInstance: chatService
    });
}
const AutopilotChatAgentModeSelector = /*#__PURE__*/ react.memo(AutopilotChatAgentModeSelectorComponent);
export { AutopilotChatAgentModeSelector };
