Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add task solution #1731

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add task solution #1731

wants to merge 1 commit into from

Conversation

Welbrn
Copy link

@Welbrn Welbrn commented Dec 24, 2024

Copy link

@natalia646 natalia646 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on implementing the task requirements! 🎉 While there are a few minor improvements suggested, such as ensuring slug uniqueness and enhancing error messages, these don't significantly impact the functionality. Keep up the good work and consider these suggestions for future enhancements! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

.then(data => {
setPeople(data);
})
.catch(() => setIsError(true))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider providing more detailed error information to the user. Currently, the error message is generic ('Something went wrong'). If possible, include specific error details to help users understand what went wrong.


<tbody>
{peopleWithParents.map(person => (
<PersonLink key={person.slug} person={person} people={people} />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that person.slug is a unique identifier for each person. Using non-unique keys can lead to performance issues and bugs in React. If slug is not guaranteed to be unique, consider using a different unique identifier.


export const PersonLink: React.FC<Props> = ({ person, people }) => {
const { slug } = useParams();
const isActivePerson = slug === person.slug;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that slug is a unique and reliable identifier for each person. If slug is not unique, it might cause unexpected behavior when determining the active person.

<td>
{person.mother && isPersonInTable(person.motherName) ? (
<Link
to={`/people/${person.mother.slug}`}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that person.mother.slug is defined before using it in the to prop. If person.mother is null or undefined, accessing slug will cause an error.


<td>
{person.father && isPersonInTable(person.fatherName) ? (
<Link to={`/people/${person.father.slug}`}>{person.fatherName}</Link>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that person.father.slug is defined before using it in the to prop. If person.father is null or undefined, accessing slug will cause an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants