) => {
if (event.key === "Enter" || event.key === " ") {
event.preventDefault();
handleSelect();
}
};
return (
{!showCheckboxes && item.isLoading && }
{!showCheckboxes && statusIcon}
{showCheckboxes && shouldReplaceCheckboxWithState && (
<>
{item.isLoading && }
{statusIcon}
>
)}
{showCheckboxes && !shouldReplaceCheckboxWithState && (
e.stopPropagation()}
/>
)}
{renderItem ? (
renderItem({
item,
level,
isLeaf: true,
isSelected,
hasChildren: false,
})
) : (
)}
);
}