import React__default from 'react';
import { T as Text } from './Text-es.js';
import { G as Glimmer } from './Glimmer-es.js';

var styles = {"results":"_9wfZRG5vXI8-","spinning":"_7A1FU9kI3mY-"};

const DATALIST_TOTALCOUNT_TEST_ID = "ATL-DataList-TotalCount";
function DataListTotalCountContainer({ children }) {
    return (React__default.createElement("div", { className: styles.results, "data-testid": DATALIST_TOTALCOUNT_TEST_ID }, children));
}
function DataListTotalCount({ totalCount, loading, }) {
    if (totalCount === null && loading) {
        return (React__default.createElement(DataListTotalCountContainer, null,
            React__default.createElement(Glimmer, { size: "auto", shape: "rectangle" })));
    }
    if (typeof totalCount === "number") {
        return (React__default.createElement(DataListTotalCountContainer, null,
            React__default.createElement(Text, { variation: "subdued" },
                "(",
                totalCount.toLocaleString(),
                " ",
                totalCount == 1 ? "result" : "results",
                ")")));
    }
    return null;
}

export { DATALIST_TOTALCOUNT_TEST_ID as D, DataListTotalCount as a };
