import { useTheme } from "@fiftyone/components"; import { CircularProgress } from "@material-ui/core"; import React, { Suspense } from "react"; import { RecoilValue, useRecoilValue } from "recoil"; const Loading = () => { const theme = useTheme(); return ( ); }; const EntryCounts = ({ countAtom, subcountAtom, }: { countAtom?: RecoilValue; subcountAtom?: RecoilValue; }) => { const [count, subcount] = [ countAtom ? useRecoilValue(countAtom) : null, subcountAtom ? useRecoilValue(subcountAtom) : null, ]; if (typeof count !== "number") { return ; } if (count === subcount || count === 0) { return {count.toLocaleString()}; } if (typeof subcount !== "number") { return ( ... {count.toLocaleString()} ); } return ( {subcount.toLocaleString()} of {count.toLocaleString()} ); }; export const SuspenseEntryCounts = ({ countAtom, subcountAtom, }: { countAtom: RecoilValue; subcountAtom: RecoilValue; }) => { return ( }> }> ); };