add task solution#3749
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation is correct and meets all functional requirements. The code properly handles destructuring, optional age fields, gendered partner labels, and marital status messaging. All specified requirements from the task are working as expected. However, there are two code style issues that need attention per the checklist: the ternary operator on line 7 should have its operands on separate lines for better readability [CHECKLIST ITEM #2], and the partner label logic (person.sex === 'm' ? 'wife' : 'husband') should be extracted to a separate variable before the return statement [CHECKLIST ITEM #3]. These are formatting and readability improvements rather than functional issues—your code will work correctly regardless. Since the core functionality is implemented properly and these are stylistic checklist violations, I'm approving the submission. Keep up the good work on the implementation!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| {person.isMarried | ||
| ? `${person.partnerName} is my ${person.sex === 'm' ? 'wife' : 'husband'}` |
There was a problem hiding this comment.
According to checklist item #2, format ternary operator operands correctly - move each operand to the separate line. The ternary on line 7 should have condition, true value, and false value on separate lines.
| {person.age && <p className="Person__age">I am {person.age}</p>} | ||
| <p className="Person__partner"> | ||
| {person.isMarried | ||
| ? `${person.partnerName} is my ${person.sex === 'm' ? 'wife' : 'husband'}` |
There was a problem hiding this comment.
According to checklist item #3, avoid putting several cases to conditional rendering. Create a separate variable for the partner label logic (person.sex === 'm' ? 'wife' : 'husband') to improve readability.
https://chlodav.github.io/react_person/