Skip to content

solution#1159

Open
boggeniys wants to merge 1 commit intomate-academy:masterfrom
boggeniys:develop
Open

solution#1159
boggeniys wants to merge 1 commit intomate-academy:masterfrom
boggeniys:develop

Conversation

@boggeniys
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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.

Review Summary

This implementation has two critical blockers that prevent task completion. First, the delay prop is missing — the task requires this to be customizable via props with a default of 300ms, but your component uses an internal useState(300) instead of accepting it as a prop. Second, the onSelected callback is not being invoked — you have a state variable named onSelected which shadows the prop callback, and you're setting internal state instead of calling the passed callback function with the selected person. To fix: add a props interface with delay?: number (default 300) and onSelected: (person: Person) => void, and call props.onSelected(person) when a suggestion is clicked rather than updating internal state. These are explicit requirements from the task that must be implemented for the component to work as specified.


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

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/App.tsx
Comment on lines +1 to +10
import React, { useMemo, useState } from 'react';
import './App.scss';
import { peopleFromServer } from './data/people';
import debounce from 'lodash.debounce';
import { Person } from './types/Person';

export const App: React.FC = () => {
const { name, born, died } = peopleFromServer[0];
const [query, setQuery] = useState('');
const [appliedQuery, setAppliedQuery] = useState('');
const [delay] = useState(300);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The delay prop is missing. The task requires delay to be customizable via props with default 300ms, but this component has no props interface and no delay parameter.

Comment thread src/App.tsx
Comment on lines +1 to +11
import React, { useMemo, useState } from 'react';
import './App.scss';
import { peopleFromServer } from './data/people';
import debounce from 'lodash.debounce';
import { Person } from './types/Person';

export const App: React.FC = () => {
const { name, born, died } = peopleFromServer[0];
const [query, setQuery] = useState('');
const [appliedQuery, setAppliedQuery] = useState('');
const [delay] = useState(300);
const [onSelected, setOnSelected] = useState<Person | null>(null);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The task requires passing selected person to onSelected callback passed via props. Currently using internal state setOnSelected instead of accepting and calling an onSelected prop callback function.

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.

2 participants