Shaping CurrentFirmSchemaCreate arch

This commit is contained in:
2025-04-16 19:43:00 +02:00
parent e5a2539ec6
commit b0c4128e01
2 changed files with 13 additions and 2 deletions

View File

@@ -1,12 +1,16 @@
import {FormContextType, getTemplate, RJSFSchema, StrictRJSFSchema, WidgetProps} from "@rjsf/utils";
import ForeignKeyWidget from "./foreign-key";
import Typography from "@mui/material/Typography";
export default function CrudTextWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
props: WidgetProps<T, S, F>
) {
if (props.schema.hasOwnProperty("foreign_key")) {
const { schema } = props;
if (schema.hasOwnProperty("foreign_key")) {
return (<ForeignKeyWidget {...props} />);
} else if (schema.hasOwnProperty("const")) {
return <Typography >{schema.const as string}</Typography>;
} else {
const { options, registry } = props;
const BaseInputTemplate = getTemplate<'BaseInputTemplate', T, S, F>('BaseInputTemplate', registry, options);