feat(ui): add Done button to ModelSelectModal in combo creation (#1031)

This commit is contained in:
Zanuar Tri Romadon
2026-05-12 09:23:51 +07:00
committed by GitHub
parent 8f4d29caa4
commit 17cab0ed52
2 changed files with 21 additions and 2 deletions
+7 -2
View File
@@ -86,6 +86,9 @@ export default function ComboFormModal({ isOpen, combo, onClose, onSave, activeP
const handleAddModel = (model) => {
if (!models.includes(model.value)) setModels([...models, model.value]);
};
const handleDeselectModel = (model) => {
setModels(models.filter((m) => m !== model.value));
};
const handleRemoveModel = (i) => setModels(models.filter((_, idx) => idx !== i));
const handleMoveUp = (i) => {
if (i === 0) return;
@@ -164,8 +167,10 @@ export default function ComboFormModal({ isOpen, combo, onClose, onSave, activeP
</Modal>
<ModelSelectModal isOpen={showModelSelect} onClose={() => setShowModelSelect(false)}
onSelect={handleAddModel} activeProviders={activeProviders} modelAliases={modelAliases}
title="Add Model to Combo" kindFilter={kindFilter} />
onSelect={handleAddModel} onDeselect={handleDeselectModel}
activeProviders={activeProviders} modelAliases={modelAliases}
title="Add Model to Combo" kindFilter={kindFilter}
addedModelValues={models} closeOnSelect={false} />
</>
);
}