From edf503e329b7a33693a499726e0257077799d75b Mon Sep 17 00:00:00 2001 From: Jelaletdin12 Date: Thu, 10 Sep 2026 15:59:05 +0500 Subject: [PATCH] fixed some statuses and filters --- src/components/dataTableToolbar.tsx | 4 +- src/components/formInput.tsx | 44 +++-- src/components/infiniteSelect.tsx | 155 +++++++++--------- src/constants/statusCells.tsx | 15 +- src/constants/statusOptions.ts | 58 ++++--- .../api/cardTransactionsApi.ts | 6 +- .../currencyRates/hooks/useCurrencyRates.ts | 9 +- .../api/loanPaidOffLettersApi.ts | 2 +- .../hooks/useVisaMasterPayments.ts | 67 ++++---- src/layouts/DashboardLayout.tsx | 4 +- .../cardDepartment/cardBalance/index.tsx | 2 +- src/pages/cardDepartment/cardPins/index.tsx | 8 +- .../cardDepartment/cardRequisites/index.tsx | 8 +- .../cardDepartment/cardTransactions/index.tsx | 131 ++++++++++++++- src/pages/currencies/currencyRates/index.tsx | 8 +- src/pages/dashboard/index.tsx | 6 +- .../visaMasterPayments/index.tsx | 8 +- .../loanDepartment/loanOrderMobile/index.tsx | 8 +- src/pages/loanDepartment/loanOrders/index.tsx | 24 +-- .../loanDepartment/loanRemaining/index.tsx | 2 +- 20 files changed, 355 insertions(+), 214 deletions(-) diff --git a/src/components/dataTableToolbar.tsx b/src/components/dataTableToolbar.tsx index 3214898..508a9a0 100644 --- a/src/components/dataTableToolbar.tsx +++ b/src/components/dataTableToolbar.tsx @@ -241,14 +241,14 @@ function FilterDropdown({ - + {/* Header */}

{t("table.filters", "Filters")}

{/* Fields */} -
+
{filterFields.map((field) => { const current = getActiveValue(field.id); const isFieldActive = current !== ""; diff --git a/src/components/formInput.tsx b/src/components/formInput.tsx index 788c442..35c48ad 100644 --- a/src/components/formInput.tsx +++ b/src/components/formInput.tsx @@ -1,4 +1,4 @@ -import { useState, useRef, useEffect } from "react"; +import { useState, useRef, useEffect, useMemo } from "react"; import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"; import { Check, ChevronsUpDown, Search, X, Eye, EyeOff, Upload, Hash, CreditCard } from "lucide-react"; @@ -257,7 +257,7 @@ function PhoneInput({
@@ -491,12 +491,12 @@ function DateInput({ value = "", onChange, error, disabled, required, label, cla type="button" disabled={disabled} className={cn( - "flex h-8 w-full items-center justify-between rounded-md border bg-background px-3 py-2", + "flex h-8 w-full items-center justify-between rounded-md border border-input bg-transparent dark:bg-input/30 px-3 py-2", "text-sm ring-offset-background transition-colors duration-150", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0", "disabled:cursor-not-allowed disabled:opacity-50", error ? "border-destructive" : "border-input", - !selected && "text-muted-foreground/60", + !selected && "text-muted-foreground", )} > {selected ? format(selected, "dd.MM.yyyy") : placeholder} @@ -539,7 +539,16 @@ function SelectInput({ }: FormInputProps) { const [open, setOpen] = useState(false); - const selected = options.find((o) => o.value === value); + const uniqueOptions = useMemo(() => { + const seen = new Set(); + return options.filter((opt) => { + if (seen.has(opt.value)) return false; + seen.add(opt.value); + return true; + }); + }, [options]); + + const selected = uniqueOptions.find((o) => o.value === value); const handleSelect = (val: string) => { onChange?.(val); @@ -561,7 +570,7 @@ function SelectInput({ type="button" disabled={disabled} className={cn( - "flex h-8 w-full items-center justify-between rounded-md border bg-background px-3 py-2", + "flex h-8 w-full items-center justify-between rounded-md border border-input bg-transparent dark:bg-input/30 px-3 py-2", "text-sm ring-offset-background transition-colors duration-150", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0", "disabled:cursor-not-allowed disabled:opacity-50", @@ -569,7 +578,7 @@ function SelectInput({ open && !error && "ring-2 ring-ring ring-offset-0 border-transparent", )} > - + {selected ? selected.label : placeholder}
- {options.map((opt) => { + {uniqueOptions.map((opt) => { const isSelected = opt.value === value; return (
- + - - {onSearchChange && ( -
- - onSearchChange(e.target.value)} - placeholder={searchPlaceholder} - className="flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 focus:outline-none" - /> - {searchValue && ( - - )} -
- )} - -
- {loading && options.length === 0 ? ( -

- Loading... -

- ) : options.length === 0 ? ( -

Netije tapylmady

- ) : ( - options.map((opt) => { - const isSelected = opt.value === value; - return ( + + + {onSearchChange && ( +
+ + onSearchChange(e.target.value)} + placeholder={searchPlaceholder} + className="flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 focus:outline-none" + /> + {searchValue && ( - ); - }) - )} - - {hasNextPage && ( -
- {isLoadingMore && ( - - Loading... - )}
)} -
- - + +
+ {loading && options.length === 0 ? ( +

+ Loading... +

+ ) : options.length === 0 ? ( +

Netije tapylmady

+ ) : ( + options.map((opt) => { + const isSelected = opt.value === value; + return ( + + ); + }) + )} + + {hasNextPage && ( +
+ {isLoadingMore && ( + + Loading... + + )} +
+ )} +
+
+
+ {error && (

diff --git a/src/constants/statusCells.tsx b/src/constants/statusCells.tsx index 76d004c..a39bbf1 100644 --- a/src/constants/statusCells.tsx +++ b/src/constants/statusCells.tsx @@ -1,18 +1,7 @@ import { useTranslation } from "react-i18next"; -import { Clock, CheckCircle2, XCircle, CheckCheck } from "lucide-react"; +import { CheckCircle2, XCircle } from "lucide-react"; import { StatusBadge, type StatusBadgeVariant } from "@/components/ui/statusBadge"; -import { STATUS_BADGE_VARIANTS, isStatusValue, getStatusLabel, type StatusValue } from "@/constants/statusOptions"; - -export const STATUS_ICONS: Record = { - pending: Clock, - approved: CheckCircle2, - rejected: XCircle, - completed: CheckCheck, - satisfied: CheckCircle2, - processing: Clock, - cancelled: XCircle, - registered: CheckCircle2, -}; +import { STATUS_ICONS, STATUS_BADGE_VARIANTS, isStatusValue, getStatusLabel } from "@/constants/statusOptions"; interface StatusCellProps { status: string; diff --git a/src/constants/statusOptions.ts b/src/constants/statusOptions.ts index d88d248..f802f86 100644 --- a/src/constants/statusOptions.ts +++ b/src/constants/statusOptions.ts @@ -1,16 +1,31 @@ import type { TFunction } from "i18next"; +import type { ComponentType } from "react"; +import { Clock, CheckCircle2, XCircle, CheckCheck } from "lucide-react"; import type { SelectOption } from "@/components/formInput"; import type { StatusBadgeVariant } from "@/components/ui/statusBadge"; +export const STATUS_ICONS: Record = { + pending: Clock, + approved: CheckCircle2, + rejected: XCircle, + completed: CheckCheck, + // satisfied: CheckCircle2, + // processing: Clock, + // cancelled: XCircle, + // registered: CheckCircle2, +}; + +export const DEFAULT_STATUS_VALUES = ["pending", "approved", "rejected", "completed"] as const; + export const STATUS_VALUES = [ "pending", "approved", "rejected", "completed", - "satisfied", - "processing", - "cancelled", - "registered", + // "satisfied", + // "processing", + // "cancelled", + // "registered", ] as const; export type StatusValue = (typeof STATUS_VALUES)[number]; @@ -20,18 +35,23 @@ export const STATUS_OPTIONS: SelectOption[] = [ { value: "approved", label: "Approved" }, { value: "rejected", label: "Rejected" }, { value: "completed", label: "Completed" }, - { value: "satisfied", label: "Satisfied" }, - { value: "processing", label: "Processing" }, - { value: "cancelled", label: "Cancelled" }, - { value: "registered", label: "Registered" }, ]; type TranslateFn = TFunction | ((key: string, fallback?: string) => string); -export function getStatusOptions(t?: TranslateFn, prefix = "status"): SelectOption[] { - if (!t) return STATUS_OPTIONS; +export function getStatusOptions( + t?: TranslateFn, + prefix = "status", + values: readonly StatusValue[] = DEFAULT_STATUS_VALUES, +): SelectOption[] { + if (!t) { + return values.map((val) => ({ + value: val, + label: STATUS_LABEL_FALLBACKS[val] ?? val, + })); + } - return STATUS_VALUES.map((val) => ({ + return values.map((val) => ({ value: val, label: t(`${prefix}.${val}`, STATUS_LABEL_FALLBACKS[val] ?? val), })); @@ -42,10 +62,10 @@ export const STATUS_BADGE_VARIANTS: Record = { approved: "success", rejected: "error", completed: "info", - satisfied: "success", - processing: "info", - cancelled: "error", - registered: "default", + // satisfied: "success", + // processing: "info", + // cancelled: "error", + // registered: "default", }; export const STATUS_LABEL_FALLBACKS: Record = { @@ -53,10 +73,10 @@ export const STATUS_LABEL_FALLBACKS: Record = { approved: "Approved", rejected: "Rejected", completed: "Completed", - satisfied: "Satisfied", - processing: "Processing", - cancelled: "Cancelled", - registered: "Registered", + // satisfied: "Satisfied", + // processing: "Processing", + // cancelled: "Cancelled", + // registered: "Registered", }; export function isStatusValue(value: string): value is StatusValue { diff --git a/src/features/cardTransactions/api/cardTransactionsApi.ts b/src/features/cardTransactions/api/cardTransactionsApi.ts index c5c873b..b6c462d 100644 --- a/src/features/cardTransactions/api/cardTransactionsApi.ts +++ b/src/features/cardTransactions/api/cardTransactionsApi.ts @@ -46,6 +46,8 @@ export interface CardListParams { page?: number; limit?: number; search?: string; + user_id?: number; + type?: number; } // ─── API functions ──────────────────────────────────────────────────────────── @@ -53,9 +55,9 @@ export interface CardListParams { export const cardTransactionsApi = { /** GET /cards */ getAll: async (params: CardListParams = {}, signal?: AbortSignal): Promise => { - const { page, limit, search } = params; + const { page, limit, search, user_id, type } = params; const { data } = await apiClient.get("/cards", { - params: { page, limit, search }, + params: { page, limit, search, user_id, type }, signal, }); return data; diff --git a/src/features/currencyRates/hooks/useCurrencyRates.ts b/src/features/currencyRates/hooks/useCurrencyRates.ts index 0ffd4be..8549d4f 100644 --- a/src/features/currencyRates/hooks/useCurrencyRates.ts +++ b/src/features/currencyRates/hooks/useCurrencyRates.ts @@ -1,6 +1,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { toast } from "sonner"; import { useTranslation } from "react-i18next"; +import { useDebouncedValue, normalizeSearch } from "@/hooks/useDebouncedSearch"; import { currencyRatesApi, type CurrencyRateListParams, @@ -21,9 +22,13 @@ export const currencyRateKeys = { // ─── List ───────────────────────────────────────────────────────────────────── export function useGetCurrencyRates(params: CurrencyRateListParams = {}) { + const debouncedSearch = useDebouncedValue(params.search ?? ""); + const normalized = normalizeSearch(debouncedSearch); + const queryParams: CurrencyRateListParams = { ...params, search: normalized || undefined }; + return useQuery({ - queryKey: currencyRateKeys.list(params), - queryFn: ({ signal }) => currencyRatesApi.getList(params, signal), + queryKey: currencyRateKeys.list(queryParams), + queryFn: ({ signal }) => currencyRatesApi.getList(queryParams, signal), placeholderData: (prev) => prev, }); } diff --git a/src/features/loanPaidOffLetters/api/loanPaidOffLettersApi.ts b/src/features/loanPaidOffLetters/api/loanPaidOffLettersApi.ts index 1a40eba..c7e0b1a 100644 --- a/src/features/loanPaidOffLetters/api/loanPaidOffLettersApi.ts +++ b/src/features/loanPaidOffLetters/api/loanPaidOffLettersApi.ts @@ -92,7 +92,7 @@ export async function fetchLoanPaidOffLetters( params: { page, limit, - customer_name: search || undefined, + name: search || undefined, passport_id: passport_id || undefined, status: status || undefined, branch_id: branch_id || undefined, diff --git a/src/features/visaMasterPayments/hooks/useVisaMasterPayments.ts b/src/features/visaMasterPayments/hooks/useVisaMasterPayments.ts index 430c6f2..4404cf1 100644 --- a/src/features/visaMasterPayments/hooks/useVisaMasterPayments.ts +++ b/src/features/visaMasterPayments/hooks/useVisaMasterPayments.ts @@ -1,69 +1,74 @@ -import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query' -import { toast } from 'sonner' -import { useTranslation } from 'react-i18next' +import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; +import { toast } from "sonner"; +import { useTranslation } from "react-i18next"; +import { useDebouncedValue, normalizeSearch } from "@/hooks/useDebouncedSearch"; import { intlPaymentApi, type IntlPaymentListParams, type IntlPaymentCreatePayload, type IntlPaymentUpdatePayload, -} from '../api/visaMasterPaymentsApi' +} from "../api/visaMasterPaymentsApi"; export const INTL_PAYMENT_KEYS = { - all: ['intl-payments-visa'] as const, - lists: () => [...INTL_PAYMENT_KEYS.all, 'list'] as const, - list: (p: IntlPaymentListParams) => [...INTL_PAYMENT_KEYS.lists(), p] as const, - detail: (id: string) => [...INTL_PAYMENT_KEYS.all, 'detail', id] as const, -} + all: ["intl-payments-visa"] as const, + lists: () => [...INTL_PAYMENT_KEYS.all, "list"] as const, + list: (p: IntlPaymentListParams) => [...INTL_PAYMENT_KEYS.lists(), p] as const, + detail: (id: string) => [...INTL_PAYMENT_KEYS.all, "detail", id] as const, +}; export function useIntlPayments(params: IntlPaymentListParams) { + const debouncedSearch = useDebouncedValue(params.search ?? ""); + const normalized = normalizeSearch(debouncedSearch); + const queryParams: IntlPaymentListParams = { ...params, search: normalized || undefined }; + return useQuery({ - queryKey: INTL_PAYMENT_KEYS.list(params), - queryFn: () => intlPaymentApi.list(params), + queryKey: INTL_PAYMENT_KEYS.list(queryParams), + queryFn: () => intlPaymentApi.list(queryParams), placeholderData: (prev) => prev, - }) + }); } export function useIntlPayment(id: string) { return useQuery({ queryKey: INTL_PAYMENT_KEYS.detail(id), - queryFn: () => intlPaymentApi.getById(id), - enabled: !!id, - }) + queryFn: () => intlPaymentApi.getById(id), + enabled: !!id, + }); } export function useCreateIntlPayment() { - const qc = useQueryClient() - const { t } = useTranslation() + const qc = useQueryClient(); + const { t } = useTranslation(); return useMutation({ mutationFn: (payload: IntlPaymentCreatePayload) => intlPaymentApi.create(payload), onSuccess: () => { - qc.invalidateQueries({ queryKey: INTL_PAYMENT_KEYS.lists() }) - toast.success(t('intlPayment.createSuccess', 'Töleg döredildi')) + qc.invalidateQueries({ queryKey: INTL_PAYMENT_KEYS.lists() }); + toast.success(t("intlPayment.createSuccess", "Töleg döredildi")); }, - }) + }); } export function useUpdateIntlPayment(id: string) { - const qc = useQueryClient() - const { t } = useTranslation() + const qc = useQueryClient(); + const { t } = useTranslation(); return useMutation({ mutationFn: (payload: IntlPaymentUpdatePayload) => intlPaymentApi.update(id, payload), onSuccess: () => { - qc.invalidateQueries({ queryKey: INTL_PAYMENT_KEYS.lists() }) - qc.invalidateQueries({ queryKey: INTL_PAYMENT_KEYS.detail(id) }) - toast.success(t('intlPayment.updateSuccess', 'Töleg üýtgedildi')) + qc.invalidateQueries({ queryKey: INTL_PAYMENT_KEYS.lists() }); + qc.invalidateQueries({ queryKey: INTL_PAYMENT_KEYS.detail(id) }); + toast.success(t("intlPayment.updateSuccess", "Töleg üýtgedildi")); }, - }) + }); } export function useDeleteIntlPayment() { - const qc = useQueryClient() - const { t } = useTranslation() + const qc = useQueryClient(); + const { t } = useTranslation(); return useMutation({ mutationFn: (id: string) => intlPaymentApi.delete(id), onSuccess: () => { - qc.invalidateQueries({ queryKey: INTL_PAYMENT_KEYS.lists() }) - toast.success(t('intlPayment.deleteSuccess', 'Töleg pozuldy')) + qc.invalidateQueries({ queryKey: INTL_PAYMENT_KEYS.lists() }); + toast.success(t("intlPayment.deleteSuccess", "Töleg pozuldy")); }, - }) + }); } diff --git a/src/layouts/DashboardLayout.tsx b/src/layouts/DashboardLayout.tsx index 374a927..6f760f3 100644 --- a/src/layouts/DashboardLayout.tsx +++ b/src/layouts/DashboardLayout.tsx @@ -98,7 +98,7 @@ function NavSubGroup({ subItem, pathname }: { subItem: NavSubItem; pathname: str

-
- + {/* { setSearch(v); setPage(1); }} placeholder={t("common.search", "Gözlemek")} - /> + /> */} navigate("/card-pins/create")} />
diff --git a/src/pages/cardDepartment/cardRequisites/index.tsx b/src/pages/cardDepartment/cardRequisites/index.tsx index 9de24b5..71e636c 100644 --- a/src/pages/cardDepartment/cardRequisites/index.tsx +++ b/src/pages/cardDepartment/cardRequisites/index.tsx @@ -6,7 +6,7 @@ import type { ColumnDef, VisibilityState } from "@tanstack/react-table"; import { DataTable } from "@/components/dataTable"; import { DataTableToolbar, type ActiveFilter, type FilterField } from "@/components/dataTableToolbar"; -import { TableSearchInput } from "@/components/tableSearch"; +// import { TableSearchInput } from "@/components/tableSearch"; import { CreateButton } from "@/components/createButton"; import { TableActions } from "@/components/tableActions"; @@ -336,15 +336,15 @@ export default function CardRequisitesPage() {

{t("cardRequisites.title", "Kart rekwizitler")}

-
- + {/* { setSearch(v); setPage(1); }} placeholder={t("cardRequisites.searchPlaceholder", "Gözlemek")} - /> + /> */} navigate("/card-requisites/create")} diff --git a/src/pages/cardDepartment/cardTransactions/index.tsx b/src/pages/cardDepartment/cardTransactions/index.tsx index 63bd01b..f8951f0 100644 --- a/src/pages/cardDepartment/cardTransactions/index.tsx +++ b/src/pages/cardDepartment/cardTransactions/index.tsx @@ -1,15 +1,16 @@ -import { useState } from "react"; +import { useState, useMemo, useCallback } from "react"; import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { DeleteDialog } from "@/components/deleteDialog"; import { DataTable, type ColumnDef } from "@/components/dataTable"; -import { DataTableToolbar, type ColumnMeta } from "@/components/dataTableToolbar"; -import { TableSearchInput } from "@/components/tableSearch"; +import { DataTableToolbar, type ColumnMeta, type ActiveFilter, type FilterField } from "@/components/dataTableToolbar"; import { CreateButton } from "@/components/createButton"; import { TableActions } from "@/components/tableActions"; import type { VisibilityState } from "@tanstack/react-table"; import { useCardTransactions, useDeleteCardTransaction } from "@/features/cardTransactions/hooks/useCardTransactions"; import type { Card } from "@/features/cardTransactions/api/cardTransactionsApi"; +import { useInfiniteClients } from "@/features/clients/hooks/useClients"; +import { useInfiniteCardTypes } from "@/features/cardTypes/hooks/useCardTypes"; import { formatFromApiDate } from "@/lib/utils"; // ─── Page ───────────────────────────────────────────────────────────────────── @@ -27,9 +28,121 @@ export default function CardTransactionsPage() { const [columnVisibility, setColumnVisibility] = useState({}); const [columnOrder, setColumnOrder] = useState([]); - const { data, isLoading } = useCardTransactions({ page, limit: perPage, search }); + const [activeFilters, setActiveFilters] = useState([ + { fieldId: "user_id", value: "" }, + { fieldId: "type", value: "" }, + ]); + + // ── Filter option sources ─────────────────────────────────────────────────── + const [userSearch, setUserSearch] = useState(""); + const { + data: usersData, + fetchNextPage: fetchNextUsers, + hasNextPage: hasNextUsers, + isFetchingNextPage: isFetchingNextUsers, + isLoading: isUsersLoading, + } = useInfiniteClients(userSearch); + + const userOptions = useMemo( + () => + (usersData?.pages ?? []).flatMap((page) => + (page?.users ?? []).map((u) => ({ + value: String(u.id), + label: u.name || u.username || String(u.id), + })), + ), + [usersData], + ); + + const [typeSearch, setTypeSearch] = useState(""); + const { + data: cardTypesData, + fetchNextPage: fetchNextCardTypes, + hasNextPage: hasNextCardTypes, + isFetchingNextPage: isFetchingNextCardTypes, + isLoading: isCardTypesLoading, + } = useInfiniteCardTypes(typeSearch); + + const cardTypeOptions = useMemo(() => { + const langKey = i18n.language as "tm" | "ru" | "en"; + return (cardTypesData?.pages ?? []).flatMap((p) => + (p?.paymentCards ?? []).map((c) => ({ + value: String(c.id), + label: c.title?.[langKey] || c.title?.tm || c.title?.en || String(c.id), + })), + ); + }, [cardTypesData, i18n.language]); + + // ── Query ────────────────────────────────────────────────────────────────── + const queryParams = useMemo(() => { + const filterMap = Object.fromEntries(activeFilters.map((f) => [f.fieldId, f.value])); + return { + search: search || undefined, + user_id: filterMap.user_id ? Number(filterMap.user_id) : undefined, + type: filterMap.type ? Number(filterMap.type) : undefined, + page, + limit: perPage, + }; + }, [search, activeFilters, page, perPage]); + + const { data, isLoading } = useCardTransactions(queryParams); const deleteMutation = useDeleteCardTransaction(); + const handleFilterChange = useCallback((fieldId: string, value: string) => { + setActiveFilters((prev) => prev.map((f) => (f.fieldId === fieldId ? { ...f, value } : f))); + setPage(1); + }, []); + + const handleFilterReset = useCallback(() => { + setActiveFilters((prev) => prev.map((f) => ({ ...f, value: "" }))); + setPage(1); + }, []); + + // ── Filter fields ─────────────────────────────────────────────────────────── + const filterFields = useMemo( + () => [ + { + id: "user_id", + label: t("User", "ULANYJY"), + type: "infinite-select", + options: userOptions, + loading: isUsersLoading, + isLoadingMore: isFetchingNextUsers, + hasNextPage: hasNextUsers, + onLoadMore: fetchNextUsers, + searchValue: userSearch, + onSearchChange: setUserSearch, + }, + { + id: "type", + label: t("Card type", "KART GÖRNÜŞI"), + type: "infinite-select", + options: cardTypeOptions, + loading: isCardTypesLoading, + isLoadingMore: isFetchingNextCardTypes, + hasNextPage: hasNextCardTypes, + onLoadMore: fetchNextCardTypes, + searchValue: typeSearch, + onSearchChange: setTypeSearch, + }, + ], + [ + t, + userOptions, + isUsersLoading, + isFetchingNextUsers, + hasNextUsers, + userSearch, + fetchNextUsers, + cardTypeOptions, + isCardTypesLoading, + isFetchingNextCardTypes, + hasNextCardTypes, + typeSearch, + fetchNextCardTypes, + ], + ); + // ── Columns ────────────────────────────────────────────────────────────────── const columns: ColumnDef[] = [ @@ -152,15 +265,15 @@ export default function CardTransactionsPage() {

{t("Card transactions", "Kartlar")}

-
- + {/* { setSearch(v); setPage(1); }} placeholder={t("common.search", "Gözlemek")} - /> + /> */} navigate("/card-transactions/create")} />
@@ -180,6 +293,10 @@ export default function CardTransactionsPage() { onColumnOrderChange={setColumnOrder} hideSearch hideAction + filterFields={filterFields} + activeFilters={activeFilters} + onFilterChange={handleFilterChange} + onFilterReset={handleFilterReset} perPageOptions={[10, 25, 50, 100]} perPage={perPage} onPerPageChange={(v) => { diff --git a/src/pages/currencies/currencyRates/index.tsx b/src/pages/currencies/currencyRates/index.tsx index 281157d..0b0686b 100644 --- a/src/pages/currencies/currencyRates/index.tsx +++ b/src/pages/currencies/currencyRates/index.tsx @@ -173,7 +173,11 @@ export default function CurrencyRatesPage() {

{t("currencyRates.title", "Walýuta kurslary")}

- + navigate("/currency-rates/create")} @@ -186,7 +190,7 @@ export default function CurrencyRatesPage() { hideAction searchValue={search} onSearchChange={handleSearchChange} - searchPlaceholder={t("common.search", "Gözlemek")} + searchPlaceholder={t("currencyRates.searchPlaceholder", "Walýuta boýunça gözle (möw. CNY → TMT)")} columns={toggleableColumns} columnVisibility={columnVisibility} onColumnVisibilityChange={setColumnVisibility} diff --git a/src/pages/dashboard/index.tsx b/src/pages/dashboard/index.tsx index 4189447..3f6ce1b 100644 --- a/src/pages/dashboard/index.tsx +++ b/src/pages/dashboard/index.tsx @@ -379,12 +379,12 @@ export default function DashboardPage({ isLoading: propLoading = false }: { isLo