/** * Internal dependencies */ import type { renderItemArgs } from './types'; import { getHighlightedName, getBreadcrumbsForDisplay } from './utils'; export const SearchListItem = ( { countLabel, className, depth = 0, controlId = '', item, isSelected, isSingle, onSelect, search = '', ...props }: renderItemArgs ): JSX.Element => { const showCount = countLabel !== undefined && countLabel !== null && item.count !== undefined && item.count !== null; const classes = [ className, 'woocommerce-search-list__item' ]; classes.push( `depth-${ depth }` ); if ( isSingle ) { classes.push( 'is-radio-button' ); } if ( showCount ) { classes.push( 'has-count' ); } const hasBreadcrumbs = item.breadcrumbs && item.breadcrumbs.length; const name = props.name || `search-list-item-${ controlId }`; const id = `${ name }-${ item.id }`; return ( ); }; export default SearchListItem;