Created
July 3, 2019 16:06
-
-
Save jsmanifest/fa656fc47e18c9c2d3c55a3bec2af62c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TotalVideoCount = ({ classes, total, fetching, fetchError }) => { | |
if (fetching) return <LoadingSpinner /> | |
const hasResults = !!total | |
const noResults = fetched && !total | |
const errorOccurred = !!fetchError | |
return ( | |
<Typography | |
variant="h3" | |
className={classes.root} | |
error={!!fetched && !!fetchError} | |
primary={hasResults} | |
soft={noResults || errorOccurred} | |
center | |
> | |
{noResults && 'No Results'} | |
{hasResults && `$${formatTotal(total)}`} | |
{errorOccurred && 'An error occurred.'} | |
</Typography> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment