"use client"; /** * Always-expanded model picker for the partner wizard — a plain radio list * (system default + every catalog option), no hover-to-expand animation. */ import { Check, Loader2 } from "lucide-react"; import { useTranslation } from "react-i18next"; import { llmSelectionKey, sameLLMSelection, type LLMOption, } from "@/lib/llm-options"; import type { LLMSelection } from "@/lib/unified-ws"; function formatContext(tokens?: number): string { if (!tokens || tokens <= 0) return ""; if (tokens >= 1_000_000) return `${Math.round(tokens / 100_000) / 10}M`; if (tokens >= 1_000) return `${Math.round(tokens / 1_000)}K`; return String(tokens); } function Row({ title, subtitle, trailing, selected, onClick, }: { title: string; subtitle?: string; trailing?: string; selected: boolean; onClick: () => void; }) { return ( ); } export default function PartnerModelPicker({ options, activeDefault, value, loading, error, onChange, }: { options: LLMOption[]; activeDefault: LLMSelection | null; value: LLMSelection | null; loading: boolean; error: boolean; onChange: (selection: LLMSelection | null) => void; }) { const { t } = useTranslation(); if (loading) { return (
{t( "Could not load the model catalog — the partner will use the system default.", )}
); } const defaultOption = activeDefault ? options.find((option) => sameLLMSelection(option, activeDefault)) : undefined; const defaultDetail = defaultOption ? `${defaultOption.model_name || defaultOption.model} · ${defaultOption.provider_label || defaultOption.provider}` : undefined; return ({t("No models configured yet — add providers in Settings → LLM.")}
)}