diff --git a/parts/2/courseExercise/src/App.jsx b/parts/2/courseExercise/src/App.jsx index 33c3557..65acd12 100644 --- a/parts/2/courseExercise/src/App.jsx +++ b/parts/2/courseExercise/src/App.jsx @@ -1,63 +1,52 @@ const Header = (props) => { - return
{props.partName} {props.exerciseCount}
- -} + return ( ++ {props.partName} {props.exerciseCount} +
+ ); +}; const Content = (props) => { return ( <> - {props.sections.map((section) => { - returnNumber of exercises {props.sections.reduce( - (sum, section) => { - return sum + section.exerciseCount - }, - 0 - )}
- > - ) -} - + ); +}; const App = () => { const course = { - name: 'Half Stack application development', + name: "Half Stack application development", sections: [ { - part: 'Fundamentals of React', - exerciseCount: 10 + part: "Fundamentals of React", + exerciseCount: 10, }, { - part: 'Using props to pass data', - exerciseCount: 7 + part: "Using props to pass data", + exerciseCount: 7, }, { - part: 'State of a component', - exerciseCount: 14 + part: "State of a component", + exerciseCount: 14, }, - - ] - } + ], + }; return (