{"size": 554, "ext": "js", "max_stars_repo_path": "polymath-apps/packages/polymath-issuer/src/pages/sto/components/ConfigureSTOForm/index.js", "max_stars_repo_name": "Morpheuslabs-io/sto-as-service-app-ref", "max_stars_repo_stars_event_min_datetime": "2018-09-22T15:40:13.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-21T13:49:35.000Z", "max_issues_repo_path": "polymath-apps/packages/polymath-issuer/src/pages/sto/components/ConfigureSTOForm/index.js", "max_issues_repo_name": "Morpheuslabs-io/sto-as-service-app-ref", "max_issues_repo_issues_event_min_datetime": "2018-09-19T16:30:52.000Z", "max_issues_repo_issues_event_max_datetime": "2020-09-30T20:44:45.000Z", "max_forks_repo_path": "polymath-apps/packages/polymath-issuer/src/pages/sto/components/ConfigureSTOForm/index.js", "max_forks_repo_name": "Morpheuslabs-io/sto-as-service-app-ref", "max_forks_repo_forks_event_min_datetime": "2018-09-18T16:55:45.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-29T13:33:47.000Z"}
{"max_stars_count": 17, "max_issues_count": 169, "max_forks_count": 13, "avg_line_length": 21.3076923077, "max_line_length": 78, "alphanum_fraction": 0.6696750903}
// @flow

import React from 'react';
import * as forms from './forms';

import type { STOModule } from '../../../../constants';

type Props = {|
  stoModule: STOModule,
|};

export const ConfigureSTOFormComponent = ({ stoModule }: Props) => {
  const { type } = stoModule;

  // Find the right form component for the stoModule's type
  const FormComponent = forms[type];

  if (!FormComponent) {
    throw new Error(`No form component exists for STO module type "${type}"`);
  }

  return <FormComponent />;
};

export default ConfigureSTOFormComponent;
