diff --git a/src/components/PersonLink.tsx b/src/components/PersonLink.tsx index 7ac804929..458aa20d1 100644 --- a/src/components/PersonLink.tsx +++ b/src/components/PersonLink.tsx @@ -9,12 +9,12 @@ type Props = { }; export const PersonLink: React.FC = ({ person }) => { - const { people } = useContext(GlobalContext); + const { sortedPeople, searchParams } = useContext(GlobalContext); const { user } = useParams(); const selectedUser = user; - const mother = people.find(human => human.name === person.motherName); - const father = people.find(human => human.name === person.fatherName); + const mother = sortedPeople.find(human => human.name === person.motherName); + const father = sortedPeople.find(human => human.name === person.fatherName); return ( = ({ person }) => { > = ({ person }) => { && mother ? ( = ({ person }) => { && father ? ( {father.name}