/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import React from 'react'; import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import { FormattedMessage, I18nProvider } from '@osd/i18n/react'; import { i18n } from '@osd/i18n'; import { formatNumWithCommas } from '../../../common/helpers'; export interface HitsCounterProps { /** * the number of query hits */ hits: number; /** * displays the reset button */ showResetButton: boolean; /** * resets the query */ onResetQuery: () => void; } export function HitsCounter({ hits, showResetButton, onResetQuery }: HitsCounterProps) { return ( {formatNumWithCommas(hits)}{' '} {showResetButton && ( )} ); }