import React from 'react' import {connect} from 'react-redux' /* * Quick links: * Jump to anchors for: not exported, filtered and received */ const QuickLinks = function(props) { const isLoading = props.routes.received.loading || props.routes.filtered.loading; // Do no display some dangleing "go to:" text if (isLoading) { return null; } // Handle special not exported: Default just works like // filtered or received. When loaded on demand, we override // this. let showNotExported = (!props.routes.notExported.loading && props.routes.notExported.totalResults > 0); let excludeNotExported = props.excludeNotExported || false; if (props.loadNotExportedOnDemand && !excludeNotExported) { // Show the link when nothing else is loading anymore showNotExported = !isLoading; } // Is there anything to show? if (!isLoading && !showNotExported && props.routes.notExported.totalResults == 0 && props.routes.received.totalResults == 0 && props.routes.filtered.totalResults == 0) { return null; // Nothing to do here. } return (