import React, { useState } from "react"; import { ChevronDown, Plus } from "lucide-react"; import type { AIProviderId } from "../../../../infrastructure/ai/types"; import { PROVIDER_PRESETS } from "../../../../infrastructure/ai/types"; import { useI18n } from "../../../../application/i18n/I18nProvider"; import { Button } from "../../../ui/button"; import { cn } from "../../../../lib/utils"; import { ProviderIconBadge } from "./ProviderIconBadge"; export const ADD_PROVIDER_MENU_CLASS = "absolute top-full right-0 mt-1 z-[101] min-w-[220px] max-w-[calc(100vw-2rem)] rounded-md border border-border bg-popover shadow-md py-1"; export const AddProviderDropdown: React.FC<{ onAdd: (providerId: AIProviderId) => void; }> = ({ onAdd }) => { const { t } = useI18n(); const [isOpen, setIsOpen] = useState(false); const providerIds = Object.keys(PROVIDER_PRESETS) as AIProviderId[]; return (
{isOpen && ( <> {/* Backdrop */}
setIsOpen(false)} /> {/* Menu */}
{providerIds.map((pid) => ( ))}
)}
); };