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

const ComplianceAlertsView = () => (
  <EntityRecordViewPage
    singularLabel="Compliance Alert"
    pluralLabel="Compliance Alerts"
    stateKey="compliance_alerts"
    recordKey="compliance_alerts"
    fetchRecord={fetch}
    listHref="/compliance_alerts/compliance_alerts-list"
    editHref={(id) => `/compliance_alerts/compliance_alerts-edit/?id=${id ?? ''}`}
  />
);

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

export default ComplianceAlertsView;
