done - #3856
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation meets all core functional requirements. The Person component correctly handles the person object, displays conditional age, manages married/unmarried states, and shows 'wife'/'husband' based on sex. The 3 checklist violations in Person.jsx ([CHECKLIST ITEMS #1, #2, #3]) are code style issues—accessing properties via person.property, ternary formatting, and combining conditions—rather than functional blockers. These style improvements are important for code quality, so consider destructuring the properties, formatting ternary operators across multiple lines, and extracting the partner text to a separate variable when you have a chance to refactor.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| export const Person = ({ person }) => ( | ||
| <section className="Person"> | ||
| <h2 className="Person__name">My name is {person.name}</h2> |
There was a problem hiding this comment.
Checklist Item #1 violation: While person is destructured from props, individual properties like name, age, isMarried, partnerName, and sex are accessed directly via person.property. Destructure these values from person for better code style.
| {person.isMarried | ||
| ? `${person.partnerName} is my ${person.sex === 'm' ? 'wife' : 'husband'}` |
There was a problem hiding this comment.
Checklist Item #2 violation: Ternary operator operands should each be on a separate line for readability. Consider reformatting the ternary on lines 8-9.
| {person.isMarried | ||
| ? `${person.partnerName} is my ${person.sex === 'm' ? 'wife' : 'husband'}` |
There was a problem hiding this comment.
Checklist Item #3 violation: Multiple conditions are combined in the conditional rendering (checking isMarried AND determining partner label). Create a separate variable for the partner text to improve readability and maintainability.
DEMO LINK