Sollution 1#3755
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution correctly implements all functional requirements from the task. The component properly renders person's details, handles conditional rendering for married/unmarried status, correctly displays 'wife' or 'husband' based on sex, and the Person component is used three times in App.jsx as specified. All checklist items related to functionality are satisfied. The flagged issues—nested property destructuring and ternary operator formatting—are code style improvements rather than functional blockers. These will be addressed through linter feedback, which you should apply to improve code consistency.
✨ 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> | ||
| {person.age && <p className="Person__age">I am {person.age}</p>} | ||
| {person.isMarried && ( | ||
| <p className="Person__partner"> | ||
| {person.partnerName} is my {person.sex === 'm' ? 'wife' : 'husband'} | ||
| </p> | ||
| )} | ||
| {!person.isMarried && <p className="Person__partner">I am not married</p>} | ||
| </section> |
There was a problem hiding this comment.
Checklist item #1 violation: While person is destructured from props, the nested properties (age, isMarried, sex, partnerName) are accessed directly without destructuring. Consider destructuring them as well: const { name, age, isMarried, sex, partnerName } = person;
| {person.age && <p className="Person__age">I am {person.age}</p>} | ||
| {person.isMarried && ( | ||
| <p className="Person__partner"> | ||
| {person.partnerName} is my {person.sex === 'm' ? 'wife' : 'husband'} |
There was a problem hiding this comment.
Checklist item #2 violation: The ternary operator should have each operand on a separate line for readability. Current: {person.sex === 'm' ? 'wife' : 'husband'} should be formatted with the condition, true value, and false value each on their own lines.
No description provided.