function ExerciseView({id, title, sets}) {
let number = 0;
return (
<div className="col-12" key={id}>
<h5>{title}</h5>
<table className="table table-bordered">
<tbody>
{sets.map((set) => {
return <Set {...set} number={number++} />
})}
</tbody>
</table>
</div>
);
}
class Set extends React.Component {
constructor(props) {
super(props);
this.state = {
id: props.id,
weight: null,
reps: null,
enableMaxReps: false,
number: props.number || 0,
isFilled: false,
};
}
}