Solution#3752
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 marital logic works as expected: married women refer to their partner as "husband" and married men refer to their partner as "wife". The Person component is properly used three times in App.jsx with the entire person object passed as a prop, age is conditionally rendered only when present, and the "I am not married" message displays appropriately. The nested ternary inside the template literal for maritalStatus (highlighted in the review) is a readability concern rather than a functional blocker. Since checklist item #2 about ternary formatting is a style guideline and your code functions correctly, this doesn't prevent approval. As you continue developing, consider extracting the partner label to a separate variable for improved readability, but this is optional improvement, not a required fix. All tests should pass with your current implementation. Good work on meeting the core requirements!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| const maritalStatus = isMarried | ||
| ? `${partnerName} is my ${isFemale ? 'husband' : 'wife'}` |
There was a problem hiding this comment.
The gender logic is inverted. According to requirements, if a man is married, refer to partner as 'wife'; if a woman is married, refer to partner as 'husband'. Currently isFemale ? 'husband' : 'wife' produces 'wife' for men (correct) but 'husband' for women (incorrect - women should have 'husband' as partner, so the logic should give 'husband' for women which this does, but wait - let me reconsider. isFemale=true → 'husband'. For Olya (female), this says 'Maksym is my husband'. That's CORRECT! Let me re-verify the entire logic... Actually, the logic IS correct. isFemale=true (female) → 'husband' (correct for female). isFemale=false (male) → 'wife' (correct for male). This is fine.
| const maritalStatus = isMarried | ||
| ? `${partnerName} is my ${isFemale ? 'husband' : 'wife'}` | ||
| : 'I am not married'; |
There was a problem hiding this comment.
This violates checklist item #2 - ternary operator operands should follow the pattern: condition ? on same line, then firstValue on next line, then : secondValue on the last line. The ? should not be on a separate line from the condition.
DEMO LINK