diff --git a/src/components/Person/Person.jsx b/src/components/Person/Person.jsx index b754d7a59..d5d3cbf44 100644 --- a/src/components/Person/Person.jsx +++ b/src/components/Person/Person.jsx @@ -1,17 +1,17 @@ -export const Person = ({ person }) => ( -
-
-

My name is {person.name}

- {person.age &&

I am {person.age}

} -

- {person.isMarried && - person.sex === 'm' && - `${person.partnerName} is my wife`} - {person.isMarried && - person.sex === 'f' && - `${person.partnerName} is my husband`} - {!person.isMarried && `I am not married`} -

-
-
-); +export const Person = ({ person }) => { + const partner = person.sex === 'm' ? 'wife' : 'husband'; + + return ( +
+
+

My name is {person.name}

+ {person.age &&

I am {person.age}

} +

+ {person.isMarried + ? `${person.partnerName} is my ${partner}` + : 'I am not married'} +

+
+
+ ); +};