diff --git a/src/components/PeopleManagement/index.jsx b/src/components/PeopleManagement/index.jsx index 7cf6614184..5f88a5367b 100644 --- a/src/components/PeopleManagement/index.jsx +++ b/src/components/PeopleManagement/index.jsx @@ -3,7 +3,12 @@ import { Helmet } from 'react-helmet'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import { useIntl, FormattedMessage } from '@edx/frontend-platform/i18n'; -import { ActionRow, Button, useToggle } from '@openedx/paragon'; +import { + ActionRow, + Button, + Skeleton, + useToggle, +} from '@openedx/paragon'; import { Add } from '@openedx/paragon/icons'; import Hero from '../Hero'; @@ -24,7 +29,7 @@ const PeopleManagementPage = ({ enterpriseId }) => { }); const { enterpriseSubsidyTypes } = useContext(EnterpriseSubsidiesContext); - const { data } = useAllEnterpriseGroups(enterpriseId); + const { data, isLoading: isGroupsLoading } = useAllEnterpriseGroups(enterpriseId); const hasLearnerCredit = enterpriseSubsidyTypes.includes(SUBSIDY_TYPES.budget); const hasOtherSubsidyTypes = enterpriseSubsidyTypes.includes(SUBSIDY_TYPES.license) @@ -40,6 +45,15 @@ const PeopleManagementPage = ({ enterpriseId }) => { } }, [data]); + let groupsCardSection = (); + if (!isGroupsLoading) { + if (groups && groups.length > 0) { + groupsCardSection = (); + } else { + groupsCardSection = (); + } + } + return ( <> @@ -85,11 +99,7 @@ const PeopleManagementPage = ({ enterpriseId }) => { closeModal={closeModal} /> - {groups && groups.length > 0 ? ( - - ) : ( - - )} + {groupsCardSection}