import pluralize from "pluralize"; import React, { useEffect, useState } from "react"; import System from "../../models/system"; import { numberWithCommas } from "../../utils/numbers"; export default function IndexCount() { const [indexes, setIndexes] = useState(null); useEffect(() => { async function indexCount() { setIndexes(await System.totalIndexes()); } indexCount(); }, []); if (indexes === null || indexes === 0) { return (
{numberWithCommas(indexes)} {pluralize("index", indexes)}