diff --git a/src/pages/internationalPayments/sberPayments/index.tsx b/src/pages/internationalPayments/sberPayments/index.tsx index fe77b68..e91bdfc 100644 --- a/src/pages/internationalPayments/sberPayments/index.tsx +++ b/src/pages/internationalPayments/sberPayments/index.tsx @@ -1,6 +1,7 @@ import { useState, useMemo, useCallback } from "react"; import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; +import { CreditCard } from "lucide-react"; import type { ColumnDef, VisibilityState } from "@tanstack/react-table"; import { DataTable } from "@/components/dataTable"; @@ -17,6 +18,7 @@ import { useInfiniteBranches } from "@/features/shared/hooks/useSharedBranchUser import { useInfiniteUsers } from "@/features/allUsers/hooks/useAllUsers"; import type { SberPaymentOrderItem, SberPaymentStatus } from "@/features/sberPayments/api/sberPaymentsApi"; import type { LocalizedText } from "@/features/branches/api/branchesApi"; +import { PayDialog } from "@/features/visaMasterPayments/components/PayDialog"; // ─── Helpers ───────────────────────────────────────────────────────────────── @@ -49,6 +51,7 @@ export default function SberPaymentsListPage() { const deleteMutation = useDeleteSberPaymentReal(); const [deleteTarget, setDeleteTarget] = useState(null); + const [payTarget, setPayTarget] = useState(null); const [page, setPage] = useState(1); const [perPage, setPerPage] = useState(25); const [search, setSearch] = useState(""); @@ -217,6 +220,17 @@ export default function SberPaymentsListPage() { onEdit={() => navigate(`/sber-payments/${row.original.id}/edit`)} onDelete={() => setDeleteTarget(row.original)} isDeleting={deleteMutation.isPending} + extraActions={ + row.original.status === "approved" + ? [ + { + icon: CreditCard, + title: t("intlPayment.pay.action", "Töleg et"), + onClick: () => setPayTarget(row.original), + }, + ] + : [] + } /> ), size: 90, @@ -364,6 +378,14 @@ export default function SberPaymentsListPage() { }} isLoading={deleteMutation.isPending} /> + + { + if (!open) setPayTarget(null); + }} + /> ); } diff --git a/src/pages/internationalPayments/sberPaymentsView/index.tsx b/src/pages/internationalPayments/sberPaymentsView/index.tsx index bf5a01d..ba401c7 100644 --- a/src/pages/internationalPayments/sberPaymentsView/index.tsx +++ b/src/pages/internationalPayments/sberPaymentsView/index.tsx @@ -2,11 +2,11 @@ import { format } from "date-fns"; import { Search, Download } from "lucide-react"; import { useParams, useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { useState } from "react"; import { Skeleton } from "@/components/ui/skeleton"; import { StatusCell } from "@/constants"; import { BentoGrid, BentoCard, InfoRow, AuditLog, ViewActions, type AuditRowProps } from "@/components/viewPageComponents"; import { useIntlPayment, useDeleteIntlPayment } from "@/features/visaMasterPayments/hooks/useVisaMasterPayments"; +import { PaymentHistoryTable } from "@/features/visaMasterPayments/components/PaymentHistoryTable"; import { ACCEPTED_DOC_DEFS, SENT_DOC_DEFS, docLabel, type TFn } from "@/features/sberPayments/constants/documents"; // ─── Helpers ────────────────────────────────────────────────────────────────── @@ -88,7 +88,6 @@ export default function SberPaymentViewPage() { const t: TFn = (key, fallback) => _t(key, fallback ?? key) as string; const { id } = useParams<{ id: string }>(); const navigate = useNavigate(); - const [historySearch, setHistorySearch] = useState(""); const { data: order, isLoading } = useIntlPayment(id ?? ""); const deleteMutation = useDeleteIntlPayment(); @@ -223,29 +222,7 @@ export default function SberPaymentViewPage() { {/* ── Row 5: Töleg taryhy ───────────────────────────────────────────── */} -
-
- - setHistorySearch(e.target.value)} - placeholder={t("common.search", "Gözlemek")} - className="h-9 w-full pl-9 pr-3 rounded-md border border-border bg-background text-sm focus:outline-none focus:ring-2 focus:ring-ring" - /> -
- -
-
- - - - - -
-

{t("sberPayments.view.noPaymentHistory", "Berlen kriteriýalara Töleg gabat gelmedi.")}

-
-
+