Shaping CurrentFirmSchemaCreate arch
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user