fixes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { TextField } from "@mui/material";
|
||||
import { TextField, Chip, Box } from "@mui/material";
|
||||
import type { FieldConfig } from "../../types";
|
||||
import { StringField } from "./renderers/StringField";
|
||||
import { NumberField } from "./renderers/NumberField";
|
||||
@@ -139,6 +139,32 @@ export function FormFieldRenderer({ field, value, onChange, error, fkOptions, fk
|
||||
);
|
||||
}
|
||||
|
||||
if (field.type === "array" && !field.fk) {
|
||||
return (
|
||||
<Box>
|
||||
<Chip
|
||||
label={`${field.label} (${Array.isArray(value) ? value.length : 0})`}
|
||||
size="small"
|
||||
color="default"
|
||||
variant="outlined"
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
if (field.type === "object" && !field.fk) {
|
||||
return (
|
||||
<Box>
|
||||
<Chip
|
||||
label={field.label}
|
||||
size="small"
|
||||
color="default"
|
||||
variant="outlined"
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<StringField
|
||||
field={field}
|
||||
|
||||
Reference in New Issue
Block a user