import React, { ReactElement } from 'react';
import LayoutAuthenticated from '../../layouts/Authenticated';
import { fetch } from '../../stores/payment_batches/payment_batchesSlice';
import EntityRecordViewPage from '../../components/EntityPage/EntityRecordViewPage';

const PaymentBatchesView = () => (
  <EntityRecordViewPage
    singularLabel="Payment Batch"
    pluralLabel="Payment Batchs"
    stateKey="payment_batches"
    recordKey="payment_batches"
    fetchRecord={fetch}
    listHref="/payment_batches/payment_batches-list"
    editHref={(id) => `/payment_batches/payment_batches-edit/?id=${id ?? ''}`}
  />
);

PaymentBatchesView.getLayout = function getLayout(page: ReactElement) {
  return <LayoutAuthenticated permission={'READ_PAYMENT_BATCHES'}>{page}</LayoutAuthenticated>;
};

export default PaymentBatchesView;
