Solution#3751
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The solution is working correctly and meets all functional requirements. However, two style guideline violations should be addressed: (1) Extract the ternary logic for determining partner label into a variable before JSX return; (2) Destructure individual properties from person at the component level for improved readability.
✨ 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.
This violates checklist item #3: 'Avoid putting several cases in conditional rendering. Create separate variable for the condition.' The logic ${person.sex === 'm' ? 'wife' : 'husband'} is embedded directly in the JSX. Consider extracting this to a variable like const partnerLabel = person.sex === 'm' ? 'wife' : 'husband' before the JSX and using it in the template string.
DEMO LINK