@@ -3,62 +3,80 @@ import { Card, Icon, Stack } from '@openedx/paragon';
33import { LoadingSpinner } from '@src/generic/Loading' ;
44import { getItemIcon } from '@src/generic/block-type-utils' ;
55import { Widgets } from '@openedx/paragon/icons' ;
6+ import { useCourseDetails } from '@src/course-outline/data/apiHooks' ;
67import messages from './messages' ;
78
8- export const ReviewImportDetails = ( ) => (
9- < Stack gap = { 4 } >
10- < Card >
11- < Card . Section >
12- < h4 > < FormattedMessage { ...messages . importCourseInProgressStatusTitle } /> </ h4 >
13- < p > < FormattedMessage { ...messages . importCourseInProgressStatusBody } /> </ p >
14- </ Card . Section >
15- </ Card >
16- < h4 > < FormattedMessage { ...messages . importCourseAnalysisSummary } /> </ h4 >
17- < Card >
18- < Card . Section >
19- < Stack direction = "horizontal" >
20- < Stack className = "align-items-center" gap = { 2 } >
21- < FormattedMessage { ...messages . importCourseTotalBlocks } />
9+ export const ReviewImportDetails = ( { courseId } : { courseId ?: string } ) => {
10+ const { data } = useCourseDetails ( courseId ) ;
11+
12+ return (
13+ < Stack gap = { 4 } >
14+ < Card >
15+ { data ? (
16+ < Card . Section >
17+ < h4 > < FormattedMessage { ...messages . importCourseInProgressStatusTitle } /> </ h4 >
18+ < p >
19+ < FormattedMessage
20+ { ...messages . importCourseInProgressStatusBody }
21+ values = { {
22+ courseName : data ?. title || '' ,
23+ } }
24+ />
25+ </ p >
26+ </ Card . Section >
27+ ) : (
28+ < div className = "text-center p-3" >
2229 < LoadingSpinner />
23- </ Stack >
24- < div className = "border-light-400" style = { { borderLeft : '2px solid' , height : '50px' } } />
25- < Stack className = "align-items-center" gap = { 2 } >
26- < FormattedMessage { ...messages . importCourseSections } />
27- < Stack className = "justify-content-center" direction = "horizontal" gap = { 3 } >
28- < Icon src = { getItemIcon ( 'section' ) } />
30+ </ div >
31+ ) }
32+ </ Card >
33+ < h4 > < FormattedMessage { ...messages . importCourseAnalysisSummary } /> </ h4 >
34+ < Card >
35+ < Card . Section >
36+ < Stack direction = "horizontal" >
37+ < Stack className = "align-items-center" gap = { 2 } >
38+ < FormattedMessage { ...messages . importCourseTotalBlocks } />
2939 < LoadingSpinner />
3040 </ Stack >
31- </ Stack >
32- < Stack className = "align-items-center" gap = { 2 } >
33- < FormattedMessage { ...messages . importCourseSubsections } />
34- < Stack className = "justify-content-center" direction = "horizontal" gap = { 3 } >
35- < Icon src = { getItemIcon ( 'subsection' ) } />
36- < LoadingSpinner />
41+ < div className = "border-light-400" style = { { borderLeft : '2px solid' , height : '50px' } } />
42+ < Stack className = "align-items-center" gap = { 2 } >
43+ < FormattedMessage { ...messages . importCourseSections } />
44+ < Stack className = "justify-content-center" direction = "horizontal" gap = { 3 } >
45+ < Icon src = { getItemIcon ( 'section' ) } />
46+ < LoadingSpinner />
47+ </ Stack >
3748 </ Stack >
38- </ Stack >
39- < Stack className = "align-items-center" gap = { 2 } >
40- < FormattedMessage { ... messages . importCourseUnits } / >
41- < Stack className = "justify-content-center" direction = "horizontal" gap = { 3 } >
42- < Icon src = { getItemIcon ( 'unit' ) } />
43- < LoadingSpinner / >
49+ < Stack className = "align-items-center" gap = { 2 } >
50+ < FormattedMessage { ... messages . importCourseSubsections } / >
51+ < Stack className = "justify-content-center" direction = "horizontal" gap = { 3 } >
52+ < Icon src = { getItemIcon ( 'subsection' ) } / >
53+ < LoadingSpinner />
54+ </ Stack >
4455 </ Stack >
45- </ Stack >
46- < Stack className = "align-items-center" gap = { 2 } >
47- < FormattedMessage { ...messages . importCourseComponents } />
48- < Stack className = "justify-content-center" direction = "horizontal" gap = { 3 } >
49- < Icon src = { Widgets } />
50- < LoadingSpinner />
56+ < Stack className = "align-items-center" gap = { 2 } >
57+ < FormattedMessage { ...messages . importCourseUnits } />
58+ < Stack className = "justify-content-center" direction = "horizontal" gap = { 3 } >
59+ < Icon src = { getItemIcon ( 'unit' ) } />
60+ < LoadingSpinner />
61+ </ Stack >
62+ </ Stack >
63+ < Stack className = "align-items-center" gap = { 2 } >
64+ < FormattedMessage { ...messages . importCourseComponents } />
65+ < Stack className = "justify-content-center" direction = "horizontal" gap = { 3 } >
66+ < Icon src = { Widgets } />
67+ < LoadingSpinner />
68+ </ Stack >
5169 </ Stack >
5270 </ Stack >
71+ </ Card . Section >
72+ </ Card >
73+ < h4 > < FormattedMessage { ...messages . importCourseDetailsTitle } /> </ h4 >
74+ < Card className = "p-6" >
75+ < Stack className = "align-items-center" gap = { 3 } >
76+ < LoadingSpinner />
77+ < FormattedMessage { ...messages . importCourseDetailsLoadingBody } />
5378 </ Stack >
54- </ Card . Section >
55- </ Card >
56- < h4 > < FormattedMessage { ...messages . importCourseDetailsTitle } /> </ h4 >
57- < Card className = "p-6" >
58- < Stack className = "align-items-center" gap = { 3 } >
59- < LoadingSpinner />
60- < FormattedMessage { ...messages . importCourseDetailsLoadingBody } />
61- </ Stack >
62- </ Card >
63- </ Stack >
64- ) ;
79+ </ Card >
80+ </ Stack >
81+ ) ;
82+ } ;
0 commit comments