The requirement for this task is to build a simple search box for countries. The search box must be usable mainly through the keyboard. Functionally, the component should:
Fetch data from the API (details provided below)
When typing into the search box, fetch new data from the API by using the search query parameter.
Using the keyboard arrows, while the input is still in focus, navigate results up/down:
select the previous result, or the last result when nothing is selected yet
select the next result, or the first result when nothing is selected yet
Enter
select the highlighted result (as a result of navigating to it)
Selected results should be stored, so the user is also able to de-select previously selected records.
Consider the task as some kind of pair programming, we can discuss the solution you want to implement, find trade-offs or better solutions.