|
|
|
@ -37,6 +37,18 @@ function getDownloadIcon(isGrabbing, isGrabbed, grabError) {
|
|
|
|
|
return icons.DOWNLOAD;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getDownloadKind(isGrabbed, grabError) {
|
|
|
|
|
if (isGrabbed) {
|
|
|
|
|
return kinds.SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (grabError) {
|
|
|
|
|
return kinds.DANGER;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return kinds.DEFAULT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getDownloadTooltip(isGrabbing, isGrabbed, grabError) {
|
|
|
|
|
if (isGrabbing) {
|
|
|
|
|
return '';
|
|
|
|
@ -115,7 +127,7 @@ class SearchIndexOverview extends Component {
|
|
|
|
|
<div className={styles.actions}>
|
|
|
|
|
<SpinnerIconButton
|
|
|
|
|
name={getDownloadIcon(isGrabbing, isGrabbed, grabError)}
|
|
|
|
|
kind={grabError ? kinds.DANGER : kinds.DEFAULT}
|
|
|
|
|
kind={getDownloadKind(isGrabbed, grabError)}
|
|
|
|
|
title={getDownloadTooltip(isGrabbing, isGrabbed, grabError)}
|
|
|
|
|
isDisabled={isGrabbed}
|
|
|
|
|
isSpinning={isGrabbing}
|
|
|
|
|