import React from "react"; import PropTypes from "prop-types"; import { StepProgressContainer, Progress, StepBar, StepLine } from "./StepProgress.styled"; import { ReactComponent as Checkmark } from "../../assets/images/svg/checkmark.svg"; const StepProgress = (props) => { const steps = []; for (let i = 1; i <= props.numberOfSteps; i++) { steps.push({ done: i < props.current, current: i === props.current, }); } const functions = []; steps.forEach((item,index) => { if (props.functions[index]) { functions.push(props.functions[index]) } else { functions.push(() => {}) } }) return ( {steps.map((item, index) => index === 0 ? ( {console.log("neuspeh")}}> {item.done ? : index+1} ) : ( {}} > {item.done ? : index+1} ) )} ); }; StepProgress.propTypes = { children: PropTypes.node, handleNext: PropTypes.node, current: PropTypes.number, numberOfSteps: PropTypes.number, functions: PropTypes.array }; StepProgress.defaultProps = { functions: [] } export default StepProgress;