function pluralize(count: number, word: "клиент" | "сеанс"): string {
  const cases = [2, 0, 1, 1, 1, 2];
  const index =
    count % 100 > 4 && count % 100 < 20
      ? 2
      : cases[count % 10 < 5 ? count % 10 : 5];

  const specialWords: Record<string, string[]> = {
    клиент: ["клиент", "клиента", "клиентов"],
    сеанс: ["сеанс", "сеанса", "сеансов"],
  };

  return `${count} ${specialWords[word][index]}`;
}

export default pluralize;
