add task solution#3791
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am approving your solution because all functional requirements are correctly implemented: Person renders the right markup, is used three times in App with the full person object, and the married/not‑married and age behaviors are all correct. The only issue noted is a code‑style concern in src/components/Person/Person.jsx, where the inner ternary person.sex === 'm' ? 'wife' : 'husband' is written on a single line instead of having each operand on its own line as required by [CHECKLIST ITEM #2]. This is a readability/style violation rather than a functional blocker, so it does not prevent task completion or break any behavior. To improve the code, reformat that nested ternary so the condition, the ? branch, and the : branch are each on separate lines following the “GOOD EXAMPLE” pattern from your checklist. Aside from that, your use of props destructuring, conditional rendering for age, and handling of the married status are all clear and correct. Nice work overall on meeting the task’s requirements and keeping the component logic straightforward.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| {person.age && <p className="Person__age">I am {person.age}</p>} | ||
| <p className="Person__partner"> | ||
| {person.isMarried | ||
| ? `${person.partnerName} is my ${person.sex === 'm' ? 'wife' : 'husband'}` |
There was a problem hiding this comment.
This violates checklist item #2: Format ternary operator operands correctly - move each operand to the separate line. The inner ternary person.sex === 'm' ? 'wife' : 'husband' is written in the single-line BAD EXAMPLE form and should be reformatted so each operand is on its own line.
DEMO LINK