File size: 578 Bytes
246d201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { SuggestionItem, type Suggestion } from "./suggestion-item";

interface SuggestionsProps {
  suggestions: Suggestion[];
  onSuggestionClick: (value: string) => void;
}

export function Suggestions({

  suggestions,

  onSuggestionClick,

}: SuggestionsProps) {
  return (
    <ul data-testid="suggestions" className="flex flex-col gap-4 w-full">

      {suggestions.map((suggestion, index) => (

        <SuggestionItem

          key={index}

          suggestion={suggestion}

          onClick={onSuggestionClick}

        />

      ))}

    </ul>
  );
}