55 css ,
66 ItemActionGroup ,
77 SpinLoader ,
8- spacing ,
98 Body ,
109} from '@mongodb-js/compass-components' ;
1110import type { RegularIndex } from '../../modules/regular-indexes' ;
@@ -15,26 +14,8 @@ const styles = css({
1514 justifyContent : 'flex-end' ,
1615} ) ;
1716
18- const combinedContainerStyles = css ( {
19- display : 'flex' ,
20- alignItems : 'center' ,
21- gap : spacing [ 200 ] ,
22- minWidth : spacing [ 800 ] ,
23- justifyContent : 'flex-end' ,
24- } ) ;
25-
26- const progressTextStyles = css ( {
27- fontSize : '12px' ,
28- fontWeight : 'normal' ,
29- } ) ;
30-
31- // Extended type to include buildProgress which might not be in the base RegularIndex type
32- type IndexWithProgress = RegularIndex & {
33- buildProgress ?: number ;
34- } ;
35-
3617type IndexActionsProps = {
37- index : IndexWithProgress ;
18+ index : RegularIndex ;
3819 serverVersion : string ;
3920 onDeleteIndexClick : ( name : string ) => void ;
4021 onHideIndexClick : ( name : string ) => void ;
@@ -62,7 +43,7 @@ const IndexActions: React.FunctionComponent<IndexActionsProps> = ({
6243} ) => {
6344 const indexActions : GroupedItemAction < IndexAction > [ ] = useMemo ( ( ) => {
6445 const actions : GroupedItemAction < IndexAction > [ ] = [ ] ;
65- const buildProgress = index . buildProgress ?? 0 ;
46+ const buildProgress = index . buildProgress ;
6647 const isBuilding = buildProgress > 0 && buildProgress < 1 ;
6748
6849 if ( isBuilding ) {
@@ -116,16 +97,19 @@ const IndexActions: React.FunctionComponent<IndexActionsProps> = ({
11697 [ onDeleteIndexClick , onHideIndexClick , onUnhideIndexClick , index ]
11798 ) ;
11899
119- const buildProgress = index . buildProgress ?? 0 ;
100+ const buildProgress = index . buildProgress ;
120101 if ( buildProgress > 0 && buildProgress < 1 ) {
121102 return (
122103 < div
123- className = { combinedContainerStyles }
104+ style = { {
105+ display : 'flex' ,
106+ alignItems : 'center' ,
107+ justifyContent : 'flex-end' ,
108+ gap : '8px' ,
109+ } }
124110 data-testid = "index-building-spinner"
125111 >
126- < Body className = { progressTextStyles } >
127- Building... { ( buildProgress * 100 ) | 0 } %
128- </ Body >
112+ < Body > Building... { ( buildProgress * 100 ) | 0 } %</ Body >
129113 < SpinLoader size = { 16 } title = "Index build in progress" />
130114 < ItemActionGroup < IndexAction >
131115 data-testid = "index-actions"
0 commit comments