import FormTypes from "./config-form-types";

export default function ConfirmFormComponents({ componentList, readOnly }) {
  return (
    <div>
      {componentList.map((f, idx) => {
        const Comp = FormTypes[f.type];

        if (Comp) {
          return <Comp key={idx} formItem={f} readOnly={readOnly} />;
        } else {
          return <div key={idx}>Error</div>;
        }
      })}
    </div>
  );
}
