The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rocket.Chat/apps/meteor/client/components/GenericTable/hooks/useShowingResultsLabel.ts

12 lines
433 B

import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
export const useShowingResultsLabel = () => {
const { t } = useTranslation();
return useCallback(
({ count, current, itemsPerPage }: { count: number; current: number; itemsPerPage: 25 | 50 | 100 }) =>
t('Showing_results_of', { postProcess: 'sprintf', sprintf: [current + 1, Math.min(current + itemsPerPage, count), count] }),
[t],
);
};