"use client";

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

export const PaymentSettings = function PaymentSettingsPage() {
  return (
    <PaymentListPage
      title="تنظیمات"
      description="PaymentSetting — کلید-مقدار tenant-scoped."
      resourceKey="settings"
      fetcher={(tenantId) => paymentApi.settings.list(tenantId)}
      filterKey="key"
      columns={[
        { key: "key", header: "کلید" },
        {
          key: "value",
          header: "مقدار",
          render: (r) => (
            <span className="font-mono text-xs">{JSON.stringify(r.value ?? r.data ?? "—")}</span>
          ),
        },
        { key: "created_at", header: "تاریخ", type: "datetime" },
      ]}
    />
  );
};

export default PaymentSettings;
