// @flow import React from 'react'; import Button from 'component/button'; import Page from 'component/page'; import Spinner from 'component/spinner'; import DownloadList from 'page/fileListDownloaded'; import Yrbl from 'component/yrbl'; type Props = { allDownloadedUrlsCount: number, myPurchases: Array, fetchingMyPurchases: boolean, fetchingFileList: boolean, }; function LibraryPage(props: Props) { const { allDownloadedUrlsCount, myPurchases, fetchingMyPurchases, fetchingFileList } = props; const hasDownloads = allDownloadedUrlsCount > 0 || (myPurchases && myPurchases.length); const loading = fetchingFileList || fetchingMyPurchases; return ( {loading && !hasDownloads && (
)} {!loading && !hasDownloads && (
} /> )} {hasDownloads && }
); } export default LibraryPage;