initial commit

This commit is contained in:
2021-12-10 12:03:04 +00:00
commit c46c7ddbf0
3643 changed files with 582794 additions and 0 deletions

View File

@ -0,0 +1,60 @@
/**
* External dependencies
*/
import { SearchListItem } from '@woocommerce/components';
import { Spinner } from '@wordpress/components';
import classNames from 'classnames';
interface SearchListItem {
id: string;
}
interface ExpandableSearchListItemProps {
className?: string;
item: SearchListItem;
isSelected: boolean;
isLoading: boolean;
onSelect: () => void;
disabled: boolean;
}
const ExpandableSearchListItem = ( {
className,
item,
isSelected,
isLoading,
onSelect,
disabled,
...rest
}: ExpandableSearchListItemProps ): JSX.Element => {
return (
<>
<SearchListItem
{ ...rest }
key={ item.id }
className={ className }
isSelected={ isSelected }
item={ item }
onSelect={ onSelect }
isSingle
disabled={ disabled }
/>
{ isSelected && isLoading && (
<div
key="loading"
className={ classNames(
'woocommerce-search-list__item',
'woocommerce-product-attributes__item',
'depth-1',
'is-loading',
'is-not-active'
) }
>
<Spinner />
</div>
) }
</>
);
};
export default ExpandableSearchListItem;