Created
February 10, 2020 20:33
-
-
Save surajitbasak109/d6dff1dd51c156a3e43855e1802e1128 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
const SearchItemsList = ({ searchItems, cursor, selectItem }) => { | |
return ( | |
<ul className="list-group"> | |
{searchItems.map((item, idx) => ( | |
<li | |
className={ | |
cursor === idx ? "active list-group-item" : "list-group-item" | |
} | |
key={idx} | |
onClick={() => selectItem(item.code)} | |
> | |
{item.name} | |
</li> | |
))} | |
</ul> | |
); | |
}; | |
export default SearchItemsList; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment