"use client";

import { PaymentListPage } from "@/modules/payment/components/PaymentListPage";
import { paymentApi } from "@/modules/payment/services/payment-api";

export const PaymentTransactions = function PaymentTransactionsPage() {
  return (
    <PaymentListPage
      title="تراکنش‌ها"
      description="تراکنش‌های ثبت‌شده پس از تأیید پرداخت."
      resourceKey="transactions"
      fetcher={(tenantId) => paymentApi.transactions.list(tenantId)}
      columns={[
        { key: "id", header: "شناسه" },
        { key: "amount_minor", header: "مبلغ (ریال)" },
        { key: "currency", header: "ارز" },
        { key: "status", header: "وضعیت", type: "status" },
        { key: "provider_transaction_id", header: "شناسه PSP" },
        { key: "created_at", header: "تاریخ", type: "datetime" },
      ]}
      detailHref={(row) => (row.id ? `/payment/transactions/${row.id}` : null)}
    />
  );
};

export default PaymentTransactions;
