removed db icon

This commit is contained in:
Jelaletdin12 committed 2026-10-24 22:07:16 +05:00
1 parent 879ed77121
commit 11903e23bf
7 files changed
+143 -59

No files matched your search

@@ -1,7 +1,6 @@
import { useState, useMemo } from "react";
import { useNavigate } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { Database, Eye } from "lucide-react";
import { Eye } from "lucide-react";
import type { VisibilityState } from "@tanstack/react-table";
import { DataTable, type ColumnDef, type SortingState } from "@/components/dataTable";
@@ -10,7 +9,7 @@ import { Button } from "@/components/ui/button";
import { useGetPaymentGateway } from "@/features/onlinePaymentHistory/hooks/useOnlinePaymentsHistory";
import { ActiveStatusCell } from "@/constants/statusCells";
import { formatFromApiDate } from "@/lib/utils/dateUtils";
import { PaymentDetailDialog } from "./PaymentDetailDialog";
import { PaymentDetailDialog, LastStepDialog } from "./PaymentDetailDialog";
// ─── Helpers ──────────────────────────────────────────────────────────────────
@@ -101,10 +100,10 @@ interface PaymentHistoryTableProps {
export function PaymentHistoryTable({ orderId, paymentId }: PaymentHistoryTableProps = {}) {
const { t } = useTranslation();
const navigate = useNavigate();
// ─── Dialog State ──────────────────────────────────────────────────────────
const [selectedPaymentId, setSelectedPaymentId] = useState<number | null>(null);
const [selectedOrderId, setSelectedOrderId] = useState<number | null>(null);
// ─── Pagination & Search ───────────────────────────────────────────────────
const [page, setPage] = useState(1);
@@ -258,7 +257,7 @@ export function PaymentHistoryTable({ orderId, paymentId }: PaymentHistoryTableP
cell: ({ row }) => (
<div className="flex items-center justify-end gap-1">
{/* Storage (Database) icon: opens payment detail dialog */}
<Button
{/* <Button
variant="ghost"
size="icon"
className="size-8 text-muted-foreground hover:text-foreground cursor-pointer"
@@ -269,17 +268,17 @@ export function PaymentHistoryTable({ orderId, paymentId }: PaymentHistoryTableP
}}
>
<Database className="size-4" />
</Button>
</Button> */}
{/* Eye icon: navigates to audit/history step timeline */}
{/* Eye icon: opens last-step dialog */}
<Button
variant="ghost"
size="icon"
className="size-8 text-muted-foreground hover:text-foreground cursor-pointer"
title={t("onlinePayments.auditHistory", "Töleg taryhy")}
title={t("onlinePayments.lastStep.title", "Iň soňky işlem")}
onClick={(e) => {
e.stopPropagation();
navigate(`/online-payments-history/${row.original.orderId || row.original.id}`);
setSelectedOrderId(row.original.orderId || row.original.id);
}}
>
<Eye className="size-4" />
@@ -289,7 +288,7 @@ export function PaymentHistoryTable({ orderId, paymentId }: PaymentHistoryTableP
size: 80,
},
],
[t, navigate],
[t],
);
const columnMeta: ColumnMeta[] = useMemo(
@@ -354,6 +353,15 @@ export function PaymentHistoryTable({ orderId, paymentId }: PaymentHistoryTableP
if (!open) setSelectedPaymentId(null);
}}
/>
{/* ── Last Step Dialog (Triggered on clicking eye icon) ─────────────────── */}
<LastStepDialog
orderId={selectedOrderId}
open={selectedOrderId !== null}
onOpenChange={(open) => {
if (!open) setSelectedOrderId(null);
}}
/>
</div>
);
}