Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great work on this task! I'm happy to approve your solution as it meets all the functional requirements. The Person component is implemented correctly, and you've handled all the conditional logic for displaying age and marital status perfectly.
I have one small suggestion for future improvement regarding code style. In src/components/Person/Person.jsx, the nested ternary operator is a bit hard to read on a single line. For better readability, it's a good practice to format ternaries with each operand on a new line, as mentioned in our checklist [CHECKLIST ITEM #2].
This is just a minor style point, and your logic is spot on. Excellent job!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| {age != null && <p className="Person__age">{`I am ${age}`}</p>} | ||
| <p className="Person__partner"> | ||
| {isMarried | ||
| ? `${partnerName} is my ${sex === 'm' ? 'wife' : 'husband'}` |
There was a problem hiding this comment.
This nested ternary operator is not formatted correctly. According to checklist item #2, each operand of a ternary operator should be on a new line.
For better readability, you could either format this nested ternary or extract the logic for determining the partner's title ('wife' or 'husband') into a variable before the return statement.
No description provided.