Added intake checklist modification to shop management BOD-128
This commit is contained in:
@@ -1,29 +1,16 @@
|
||||
import React from "react";
|
||||
import CheckboxFormItem from "./checkbox/checkbox.component";
|
||||
import Slider from "./slider/slider.component";
|
||||
import Text from "./text/text.component";
|
||||
import Textarea from "./textarea/textarea.component";
|
||||
import Rate from "./rate/rate.component";
|
||||
import FormTypes from "./config-form-types";
|
||||
|
||||
export default function ConfirmFormComponents({ componentList, readOnly }) {
|
||||
return (
|
||||
<div>
|
||||
{componentList.map((f, idx) => {
|
||||
switch (f.type) {
|
||||
case "checkbox":
|
||||
return (
|
||||
<CheckboxFormItem key={idx} formItem={f} readOnly={readOnly} />
|
||||
);
|
||||
case "slider":
|
||||
return <Slider key={idx} formItem={f} readOnly={readOnly} />;
|
||||
case "text":
|
||||
return <Text key={idx} formItem={f} readOnly={readOnly} />;
|
||||
case "textarea":
|
||||
return <Textarea key={idx} formItem={f} readOnly={readOnly} />;
|
||||
case "rate":
|
||||
return <Rate key={idx} formItem={f} readOnly={readOnly} />;
|
||||
default:
|
||||
return <div key={idx}>Error</div>;
|
||||
const Comp = FormTypes[f.type];
|
||||
|
||||
if (!!Comp) {
|
||||
return <Comp key={idx} formItem={f} readOnly={readOnly} />;
|
||||
} else {
|
||||
return <div key={idx}>Error</div>;
|
||||
}
|
||||
})}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user