diff --git a/src/pages/ClientsPage.tsx b/src/pages/ClientsPage.tsx index 4f2af8d..cfb62bc 100644 --- a/src/pages/ClientsPage.tsx +++ b/src/pages/ClientsPage.tsx @@ -5,10 +5,11 @@ import SpinIcon from "../components/icons/SpinIcon"; import MultySelect from "../components/MultySelect"; import SearchInput from "../components/SearchInput"; import { useState } from "react"; -import { useDebounce } from "@uidotdev/usehooks"; import { useQuery } from "@tanstack/react-query"; import { User } from "../types/User"; import { Client } from "../types/Client"; +import { useDebounce } from "@uidotdev/usehooks"; +import pluralize from "../utils/pluralize"; function ClientsPage() { const [limit, setLimit] = useState(10); @@ -42,6 +43,7 @@ function ClientsPage() { searchParams: debouncedSearch ? { search: debouncedSearch } : {}, }) .json(), + enabled: !!me, }); @@ -80,7 +82,7 @@ function ClientsPage() {

- Найдено {count} клиентов + Найдено {count ? pluralize(count, "клиент") : "0 клиентов"}

- {!!count && clients?.length === 0 && ( + {!!clients?.length && clients?.length === 0 && ( diff --git a/src/pages/SessionsPage.tsx b/src/pages/SessionsPage.tsx index 95e39aa..8b6fb16 100644 --- a/src/pages/SessionsPage.tsx +++ b/src/pages/SessionsPage.tsx @@ -14,6 +14,7 @@ import Button from "../components/Button"; import SearchInput from "../components/SearchInput"; import CloseIcon from "../components/icons/CloseIcon"; import SpinIcon from "../components/icons/SpinIcon"; +import pluralize from "../utils/pluralize"; function SessionsPage() { const [limit, setLimit] = useState(10); @@ -119,7 +120,7 @@ function SessionsPage() {

- Найдено {count} сеансов + Найдено {count ? pluralize(count, "сеанс") : "0 сеансов"}