mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 12:18:11 +00:00
vehicle
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user