message: Monitoring: Small refactoring of admin nav menu's Observe section
diff: import * as React from 'react';
  import { useTranslation } from 'react-i18next';
  -import { connect } from 'react-redux';
  +// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
  +// @ts-ignore
  +import { useSelector } from 'react-redux';
  import {
  NavItem as PluginNavItem,
  NavSection as PluginNavSection,
  @@ -26,6 +28,7 @@ import {
  } from '../../models';
  import { referenceForModel } from '../../module/k8s';
  import { featureReducerName } from '../../reducers/features';
  +import { RootState } from '../../redux';
  import { HrefLink, PluginNavItems, ResourceClusterLink, ResourceNSLink } from './items';
  import { NavSection } from './section';
  @@ -62,13 +65,18 @@ const clusterSettingsStartsWith = [
  const meteringStartsWith = ['metering.openshift.io'];
  const apiExplorerStartsWith = ['api-explorer', 'api-resource'];
  -const monitoringNavSectionStateToProps = (state) => ({
  - canAccess: !!state[featureReducerName].get(FLAGS.CAN_GET_NS),
  -});
  -
  -const MonitoringNavSection_ = ({ canAccess }) => {
  +const MonitoringNavSection: React.FC<{}> = () => {
  const { t } = useTranslation();
  - return canAccess && !!window.SERVER_FLAGS.prometheusBaseURL ? (
  +
  + const canAccess = useSelector(
  + (state: RootState) => !!state[featureReducerName].get(FLAGS.CAN_GET_NS),
  + );
  +
  + if (!canAccess || !window.SERVER_FLAGS.prometheusBaseURL) {
  + return null;
  + }
  +
  + return (
  <NavSection id="observe" title={t('public~Observe')} data-quickstart-id="qs-nav-monitoring">
  <HrefLink
  id="monitoringalerts"
  @@ -88,9 +96,8 @@ const MonitoringNavSection_ = ({ canAccess }) => {
  name={t('public~Dashboards')}
  />
  </NavSection>
  - ) : null;
  + );
  };
  -const MonitoringNavSection = connect(monitoringNavSectionStateToProps)(MonitoringNavSection_);
  export type AdminNavProps = {
  pluginNavItems: LoadedExtension<PluginNavSection | PluginNavItem | PluginNavSeparator>[];
  