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

const FieldVerificationsView = () => (
  <EntityRecordViewPage
    singularLabel="Field Verification"
    pluralLabel="Field Verifications"
    stateKey="field_verifications"
    recordKey="field_verifications"
    fetchRecord={fetch}
    listHref="/field_verifications/field_verifications-list"
    editHref={(id) => `/field_verifications/field_verifications-edit/?id=${id ?? ''}`}
  />
);

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

export default FieldVerificationsView;
