This commit is contained in:
natib21
2026-06-19 13:58:33 +00:00
parent e3aacb8b4a
commit 1c420781ea
3 changed files with 25 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import {
Modal,
NumberInput,
Select,
MultiSelect,
SimpleGrid,
Stack,
Text,
@@ -144,6 +145,28 @@ const FleetFormDialog = ({
);
}
if (field.type === "multiselect") {
const arrayValue = Array.isArray(value) ? value : (typeof value === "string" && value ? [value] : []);
return (
<MultiSelect
key={field.name}
label={field.label}
placeholder={field.placeholder || "Select options"}
data={field.options ?? []}
value={arrayValue.map(String)}
onChange={(next) =>
setValues((current) => ({ ...current, [field.name]: next }))
}
error={error}
searchable
clearable
disabled={selectOptionsLoading}
rightSection={selectOptionsLoading ? <Loader2 size={14} className="animate-spin" /> : undefined}
/>
);
}
if (field.type === "number") {
return (
<NumberInput