QuestionsPage: pluralize words using the lib "polish-plurals"

This commit is contained in:
Dawid Wysokiński 2021-04-11 11:55:20 +02:00
parent c6723e05d4
commit 71f1b2c43a
1 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import { useSnackbar } from 'notistack';
import SortParam, { decodeSort } from 'libs/serialize-query-params/SortParam';
import { useScrollToElement } from 'libs/hooks';
import useQuestions from './QuestionsPage.useQuestions';
import { polishPlurals } from 'polish-plurals';
import { validateRowsPerPage } from 'common/Table/helpers';
import {
MUTATION_CREATE_QUESTION,
@ -208,7 +209,12 @@ const QuestionsPage = () => {
<Snackbar
open={selectedQuestions.length > 0}
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
message={`Wybrane pytania: ${selectedQuestions.length}`}
message={`Wybrano ${selectedQuestions.length} ${polishPlurals(
'pytanie',
'pytania',
'pytań',
selectedQuestions.length
)}`}
action={
<>
<Button onClick={handleDeleteQuestions} color="secondary">