(feat) team add all models available

This commit is contained in:
Ishaan Jaff 2024-03-29 16:28:36 -07:00
parent e8ead49d29
commit 30a4f224ee

View file

@ -87,6 +87,17 @@ const Team: React.FC<TeamProps> = ({
setIsDeleteModalOpen(true);
};
const handleModelSelection = (selectedModels: string[]) => {
if (selectedModels.includes("all_models")) {
// Select all models except "All Models"
const allModelsExceptAll = userModels.filter(model => model !== "all");
form.setFieldsValue({
models: allModelsExceptAll
});
}
};
const confirmDelete = async () => {
if (teamToDelete == null || teams == null || accessToken == null) {
return;
@ -343,7 +354,11 @@ const Team: React.FC<TeamProps> = ({
mode="multiple"
placeholder="Select models"
style={{ width: "100%" }}
onChange={(selectedModels) => handleModelSelection(selectedModels)}
>
<Select2.Option key="all_models" value="all_models">
All Models
</Select2.Option>
{userModels.map((model) => (
<Select2.Option key={model} value={model}>
{model}
@ -351,6 +366,7 @@ const Team: React.FC<TeamProps> = ({
))}
</Select2>
</Form.Item>
<Form.Item label="Max Budget (USD)" name="max_budget">
<InputNumber step={0.01} precision={2} width={200} />
</Form.Item>