This commit is contained in:
2026-07-17 14:31:39 +05:30
parent 83ecdcb500
commit 6c720c390c
6 changed files with 134 additions and 8 deletions

View File

@@ -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}