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

const ApprovalStepsView = () => (
  <EntityRecordViewPage
    singularLabel="Approval Step"
    pluralLabel="Approval Steps"
    stateKey="approval_steps"
    recordKey="approval_steps"
    fetchRecord={fetch}
    listHref="/approval_steps/approval_steps-list"
    editHref={(id) => `/approval_steps/approval_steps-edit/?id=${id ?? ''}`}
  />
);

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

export default ApprovalStepsView;
