{"size": 990, "ext": "js", "max_stars_repo_path": "client/src/components/ProjectWizard/RuleInput/RuleInputPanels.js", "max_stars_repo_name": "hackforla/tdm-calculator", "max_stars_repo_stars_event_min_datetime": "2019-08-17T19:18:40.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-27T14:22:50.000Z", "max_issues_repo_path": "client/src/components/ProjectWizard/RuleInput/RuleInputPanels.js", "max_issues_repo_name": "hackforla/tdm-calculator", "max_issues_repo_issues_event_min_datetime": "2019-07-23T03:54:57.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T17:27:52.000Z", "max_forks_repo_path": "client/src/components/ProjectWizard/RuleInput/RuleInputPanels.js", "max_forks_repo_name": "hackforla/tdm-calculator", "max_forks_repo_forks_event_min_datetime": "2019-07-24T02:15:30.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-03T06:08:26.000Z"}
{"max_stars_count": 22, "max_issues_count": 710, "max_forks_count": 17, "avg_line_length": 27.5, "max_line_length": 71, "alphanum_fraction": 0.6575757576}
import React from "react";
import PropTypes from "prop-types";
import RuleInputList from "./RuleInputList";
import { getCalculationPanelIds, getPanelRules } from "../helpers";
import Panels from "../Common/Panels";

const RuleInputPanels = ({ rules, suppressHeader, onInputChange }) => {
  const panelIds = getCalculationPanelIds(rules);
  const panelsRules = getPanelRules(panelIds, rules);

  return (
    <React.Fragment>
      {panelsRules.map(pRules => (
        <Panels
          key={pRules[0].calculationPanelId}
          rules={pRules}
          suppressHeader={suppressHeader}
        >
          <RuleInputList
            key={pRules[0].calculationPanelId}
            rules={pRules}
            onInputChange={onInputChange}
          />
        </Panels>
      ))}
    </React.Fragment>
  );
};
RuleInputPanels.propTypes = {
  rules: PropTypes.array.isRequired,
  suppressHeader: PropTypes.bool,
  onInputChange: PropTypes.func.isRequired
};

export default RuleInputPanels;
