/* eslint-disable react/no-array-index-key */ import React, { Fragment } from "react"; import classNames from "classnames"; import { isEmpty } from "../../../utils/utils"; type IProps = { dataList: Array; refContainer: React.MutableRefObject; onListKeyPress: any; onListClick(e: React.MouseEvent): any; setIsMatched?(foo?: boolean): any; currentValue?: string; alwaysListShow?: boolean; } const List: React.FC = ({ dataList, refContainer, onListClick, onListKeyPress, currentValue, setIsMatched, alwaysListShow }) => !isEmpty(dataList) ? (
    {setIsMatched && setIsMatched(false)} {dataList.map((data, index) => { // 현재값이 데이터 와 일치되는것이 있다면 if (currentValue === data.name) { setIsMatched && setIsMatched(true); } const classes = classNames({ JDsearchInput__li: true, "JDsearchInput__li--selected": index === 0, "JDsearchInput__li--correspond": currentValue === data.name, "JDsearchInput__li--unDetail": !data.detail }); return ( // eslint-disable-next-line react/no-array-index-key ); })}
) : (
); export default List;