File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed
packages/compass-indexes/src/components/regular-indexes-table Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 44 ItemActionGroup ,
55 SpinLoader ,
66 Body ,
7+ css ,
78} from '@mongodb-js/compass-components' ;
89import type { InProgressIndex } from '../../modules/regular-indexes' ;
910
@@ -13,6 +14,13 @@ type Index = {
1314 buildProgress : number ;
1415} ;
1516
17+ const styles = css ( {
18+ display : 'flex' ,
19+ alignItems : 'center' ,
20+ justifyContent : 'flex-end' ,
21+ gap : '8px' ,
22+ } ) ;
23+
1624type IndexActionsProps = {
1725 index : Index ;
1826 onDeleteFailedIndexClick : ( name : string ) => void ;
@@ -52,14 +60,7 @@ const IndexActions: React.FunctionComponent<IndexActionsProps> = ({
5260 const isBuilding = progress > 0 && progress < 100 ;
5361
5462 return (
55- < div
56- style = { {
57- display : 'flex' ,
58- alignItems : 'center' ,
59- justifyContent : 'flex-end' ,
60- gap : '8px' ,
61- } }
62- >
63+ < div className = { styles } >
6364 { isBuilding && (
6465 < >
6566 < Body > Building... { progress | 0 } %</ Body >
Original file line number Diff line number Diff line change @@ -14,6 +14,13 @@ const styles = css({
1414 justifyContent : 'flex-end' ,
1515} ) ;
1616
17+ const buildProgressStyles = css ( {
18+ display : 'flex' ,
19+ alignItems : 'center' ,
20+ justifyContent : 'flex-end' ,
21+ gap : '8px' ,
22+ } ) ;
23+
1724type IndexActionsProps = {
1825 index : RegularIndex ;
1926 serverVersion : string ;
@@ -100,15 +107,7 @@ const IndexActions: React.FunctionComponent<IndexActionsProps> = ({
100107 const buildProgress = index . buildProgress ;
101108 if ( buildProgress > 0 && buildProgress < 1 ) {
102109 return (
103- < div
104- style = { {
105- display : 'flex' ,
106- alignItems : 'center' ,
107- justifyContent : 'flex-end' ,
108- gap : '8px' ,
109- } }
110- data-testid = "index-building-spinner"
111- >
110+ < div className = { buildProgressStyles } data-testid = "index-building-spinner" >
112111 < Body > Building... { ( buildProgress * 100 ) | 0 } %</ Body >
113112 < SpinLoader size = { 16 } title = "Index build in progress" />
114113 < ItemActionGroup < IndexAction >
You can’t perform that action at this time.
0 commit comments