"use client";

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

export const PaymentProviders = function PaymentProvidersPage() {
  return (
    <PaymentListPage
      title="تخصیص ارائه‌دهنده"
      description="PaymentProviderAssignment — انتخاب منبع پرداخت فعال."
      resourceKey="provider-assignments"
      fetcher={(tenantId) => paymentApi.providerAssignments.list(tenantId)}
      filterKey="source_type"
      columns={[
        { key: "source_type", header: "نوع منبع" },
        { key: "source_id", header: "شناسه منبع" },
        { key: "scope_type", header: "محدوده" },
        { key: "priority", header: "اولویت" },
        { key: "is_active", header: "فعال", render: (r) => (r.is_active ? "بله" : "خیر") },
      ]}
    />
  );
};

export default PaymentProviders;
