import type { FC } from 'react'; import { prettify } from '../../utils/helpers/numbers'; import type { PartialVisitsSummary } from '../../visits/reducers/visitsOverview'; import type { HighlightCardProps } from './HighlightCard'; import { HighlightCard } from './HighlightCard'; export type VisitsHighlightCardProps = Omit & { loading: boolean; excludeBots: boolean; visitsSummary: PartialVisitsSummary; }; export const VisitsHighlightCard: FC = ({ loading, excludeBots, visitsSummary, ...rest }) => ( {excludeBots ? 'Plus' : 'Including'} {prettify(visitsSummary.bots)} potential bot visits : undefined } {...rest} > {loading ? 'Loading...' : prettify( excludeBots && visitsSummary.nonBots ? visitsSummary.nonBots : visitsSummary.total, )} );