11import React from 'react' ;
22import PropTypes from 'prop-types' ;
3- import { injectIntl , intlShape } from '@edx/frontend-platform/i18n' ;
3+ import { useIntl } from '@edx/frontend-platform/i18n' ;
44import {
55 Tabs ,
66 Tab ,
@@ -14,33 +14,35 @@ const VideoInfoModalSidebar = ({
1414 video,
1515 activeTab,
1616 setActiveTab,
17- // injected
18- intl,
19- } ) => (
20- < Tabs
21- id = "controlled-info-sidebar-tab"
22- activeKey = { activeTab }
23- onSelect = { ( tab ) => setActiveTab ( tab ) }
24- >
25- < Tab eventKey = "fileInfo" title = { intl . formatMessage ( messages . infoTabTitle ) } >
26- < InfoTab { ...{ video } } />
27- </ Tab >
28- < Tab
29- eventKey = "fileTranscripts"
30- title = { intl . formatMessage (
31- messages . transcriptTabTitle ,
32- { transcriptCount : video . transcripts . length } ,
33- ) }
34- notification = { TRANSCRIPT_FAILURE_STATUSES . includes ( video . transcriptionStatus ) && (
17+ } ) => {
18+ const intl = useIntl ( ) ;
19+
20+ return (
21+ < Tabs
22+ id = "controlled-info-sidebar-tab"
23+ activeKey = { activeTab }
24+ onSelect = { ( tab ) => setActiveTab ( tab ) }
25+ >
26+ < Tab eventKey = "fileInfo" title = { intl . formatMessage ( messages . infoTabTitle ) } >
27+ < InfoTab { ...{ video } } />
28+ </ Tab >
29+ < Tab
30+ eventKey = "fileTranscripts"
31+ title = { intl . formatMessage (
32+ messages . transcriptTabTitle ,
33+ { transcriptCount : video . transcripts . length } ,
34+ ) }
35+ notification = { TRANSCRIPT_FAILURE_STATUSES . includes ( video . transcriptionStatus ) && (
3536 < span >
3637 < span className = "sr-only" > { intl . formatMessage ( messages . notificationScreenReaderText ) } </ span >
3738 </ span >
38- ) }
39- >
40- < TranscriptTab { ...{ video } } />
41- </ Tab >
42- </ Tabs >
43- ) ;
39+ ) }
40+ >
41+ < TranscriptTab { ...{ video } } />
42+ </ Tab >
43+ </ Tabs >
44+ ) ;
45+ } ;
4446
4547VideoInfoModalSidebar . propTypes = {
4648 video : PropTypes . shape ( {
@@ -54,12 +56,10 @@ VideoInfoModalSidebar.propTypes = {
5456 } ) ,
5557 activeTab : PropTypes . string . isRequired ,
5658 setActiveTab : PropTypes . func . isRequired ,
57- // injected
58- intl : intlShape . isRequired ,
5959} ;
6060
6161VideoInfoModalSidebar . defaultProps = {
6262 video : null ,
6363} ;
6464
65- export default injectIntl ( VideoInfoModalSidebar ) ;
65+ export default VideoInfoModalSidebar ;
0 commit comments