Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit b332de9

Browse files
committed
fix: plural form when select WPs in for payment
ref issue #46
1 parent 202acbf commit b332de9

File tree

1 file changed

+9
-5
lines changed
  • src/routes/WorkPeriods/components/PeriodsSelectionMessage

1 file changed

+9
-5
lines changed

src/routes/WorkPeriods/components/PeriodsSelectionMessage/index.jsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
} from "store/selectors/workPeriods";
1212
import { toggleWorkingPeriodsAll } from "store/actions/workPeriods";
1313
import styles from "./styles.module.scss";
14+
import { formatPlural } from "utils/formatters";
1415

1516
/**
1617
* Displays messages about the number of selected periods and selection controls.
@@ -36,17 +37,20 @@ const PeriodsSelectionMessage = ({ className }) => {
3637
{isSelectedVisible && totalCount > pageSize && (
3738
<span className={styles.message}>
3839
{isSelectedAll
39-
? `All ${totalCount} Records are selected. `
40-
: selectedCount < pageSize
41-
? `${selectedCount} Records on this page are selected. `
42-
: `All ${pageSize} Records on this page are selected. `}
40+
? `All ${formatPlural(totalCount, "record")} are selected. `
41+
: `${selectedCount < pageSize ? "" : "All"} ${formatPlural(
42+
selectedCount,
43+
"record"
44+
)} on this page are selected. `}
4345
<span
4446
className={styles.button}
4547
onClick={onBtnClick}
4648
role="button"
4749
tabIndex={0}
4850
>
49-
{isSelectedAll ? "Deselect" : `Select all ${totalCount} Records`}
51+
{isSelectedAll
52+
? "Deselect"
53+
: `Select all ${formatPlural(totalCount, "record")}`}
5054
</span>
5155
</span>
5256
)}

0 commit comments

Comments
 (0)