Create Person component#3763
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Changes are needed - your implementation meets all functional requirements, but there are two explicit checklist violations that must be fixed: 1. In Person.jsx, the person object is destructured from props, but its individual properties (name, age, sex, isMarried, partnerName) are not. Update your destructuring to ({ person: { name, age, sex, isMarried, partnerName } }) and replace all person.name, person.age, etc. with the direct variable names. 2. The ternary operator for isMarried needs each operand on its own separate line for readability. Format it like: javascript {isMarried ? `I am married with ${partnerName}` : 'I am not married'}
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| @@ -1 +1,11 @@ | |||
| // export const Person = ({ person }) => (); | |||
| export const Person = ({ person }) => ( | |||
There was a problem hiding this comment.
This violates checklist item #1: Use destructuring for getting access to values of props object. While person is destructured from props, its properties (name, age, sex, isMarried, partnerName) are not destructured. Consider destructuring them: ({ person: { name, age, sex, isMarried, partnerName } }) and then use the values directly instead of person.name, person.age, etc.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation is approved and meets all requirements. The Person component correctly uses nested destructuring to extract name, age, sex, isMarried, and partnerName from the passed person object. The ternary operator is properly formatted with operands on separate lines, and the component handles all functional requirements including conditional age rendering, gender-aware partner terminology (wife for men, husband for women), and the "I am not married" message for unmarried persons. All three checklist items from the previous review have been successfully addressed. Great work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
DEMO LINK