import PropTypes from 'prop-types' import React, { useRef } from 'react' import { Form, FormGroup, Input, Label } from 'reactstrap' import Modal from '../Modal' import { AVAILABLE_METRICS, METRIC_NAMES } from '../../../util/available-metrics' const NewPortfolioModalComponent = ({ show, callback }) => { const textInput = useRef(null) const repeatsInput = useRef(null) const metricCheckboxes = useRef({}) const onSubmit = () => callback(textInput.current.value, { enabledMetrics: AVAILABLE_METRICS.filter((metric) => metricCheckboxes.current[metric].checked), repeatsPerScenario: parseInt(repeatsInput.current.value), }) const onCancel = () => callback(undefined) return (
{ e.preventDefault() this.onSubmit() }} >

Targets

Metrics
{AVAILABLE_METRICS.map((metric) => ( ))}
) } NewPortfolioModalComponent.propTypes = { show: PropTypes.bool.isRequired, callback: PropTypes.func.isRequired, } export default NewPortfolioModalComponent