Skip to content

Commit

Permalink
Merge branch 'develop' into 561-tech-debt-remove-redundant-responces-…
Browse files Browse the repository at this point in the history
…in-views-fe
  • Loading branch information
YanZhylavy committed May 29, 2024
2 parents 47b55e2 + f153f19 commit d29b9f9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion FrontEnd/src/components/profileList/ProfileList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@ import css from './ProfileList.module.css';

const PAGE_SIZE = 6;

const getCompanyWord = (number) => {
if (number === 1 || (number > 20 && number % 10 === 1)) {
return 'компанія';
} else if ((number >= 2 && number <= 4) || (number > 20 && number % 10 >= 2 && number % 10 <= 4)) {
return 'компанії';
} else {
return 'компаній';
}
};

const ListHeader = ({ number }) => (
<div className={css['results-header']}>
<p className={css['results-header__number']}>{number}</p>
<p className={css['results-header__text']}>компаній</p>
<p className={css['results-header__text']}>{getCompanyWord(number)}</p>
</div>
);

Expand Down

0 comments on commit d29b9f9

Please sign in to comment.