diff --git a/src/components/search/Search.jsx b/src/components/search/Search.jsx index bf96bb8e45..b06635c4cd 100644 --- a/src/components/search/Search.jsx +++ b/src/components/search/Search.jsx @@ -27,10 +27,12 @@ import { useEnterpriseFeatures, useEnterpriseOffers, useIsAssignmentsOnlyLearner, + useSubscriptions, } from '../app/data'; import { useAlgoliaSearch } from '../../utils/hooks'; import ContentTypeSearchResultsContainer from './ContentTypeSearchResultsContainer'; import SearchVideo from './SearchVideo'; +import { LICENSE_STATUS } from '../enterprise-user-subsidy/data/constants'; export const sendPushEvent = (isPreQueryEnabled, courseKeyMetadata) => { if (isPreQueryEnabled) { @@ -91,6 +93,12 @@ const Search = () => { config.PREQUERY_SEARCH_EXPERIMENT_VARIANT_ID, ); + const { data: { subscriptionLicense } } = useSubscriptions(); + const enableVideos = ( + subscriptionLicense?.status === LICENSE_STATUS.ACTIVATED + && subscriptionLicense?.subscriptionPlan?.isCurrent + ); + const PAGE_TITLE = intl.formatMessage({ id: 'enterprise.search.page.title', defaultMessage: 'Search Courses and Programs - {enterpriseName}', @@ -152,6 +160,7 @@ const Search = () => { enterpriseConfig={enterpriseCustomer} optimizelySuggestionClickHandler={optimizelySuggestionClickHandler} isPreQueryEnabled={isPreQueryEnabled} + enableVideos={enableVideos} /> )}