1- import React , { useEffect , useState , Suspense } from 'react' ;
1+ import React , { useState , Suspense } from 'react' ;
22import { createDockerDesktopClient } from '@docker/extension-api-client' ;
3- import { Stack , Typography , Button , IconButton , Alert , DialogTitle , Dialog , DialogContent , CircularProgress , Paper , Box , SvgIcon , useTheme } from '@mui/material' ;
4- import { CatalogItemWithName } from './components/tile/Tile ' ;
3+ import { Typography , Button , IconButton , Alert , DialogTitle , Dialog , DialogContent , CircularProgress , Paper , Box , SvgIcon , useTheme } from '@mui/material' ;
4+ import { CatalogItemWithName } from './types/catalog ' ;
55import { Close } from '@mui/icons-material' ;
66import { CatalogGrid } from './components/CatalogGrid' ;
77import { POLL_INTERVAL } from './Constants' ;
88import { CatalogProvider , useCatalogContext } from './context/CatalogContext' ;
99import { ConfigProvider } from './context/ConfigContext' ;
1010import { MCPClientProvider , useMCPClientContext } from './context/MCPClientContext' ;
1111import ConfigurationModal from './components/ConfigurationModal' ;
12- import { Settings as SettingsIcon } from '@mui/icons-material' ;
1312
1413const Settings = React . lazy ( ( ) => import ( './components/Settings' ) ) ;
1514
16- // Create lazy-loaded logo components
17- const LazyDarkLogo = React . lazy ( ( ) => import ( './components/DarkLogo' ) ) ;
18- const LazyLightLogo = React . lazy ( ( ) => import ( './components/LightLogo' ) ) ;
19-
20- // Logo component that uses Suspense for conditional loading
21- const Logo = ( ) => {
22- const theme = useTheme ( ) ;
23- const isDarkMode = theme . palette . mode === 'dark' ;
24-
25- return (
26- < Suspense fallback = { < Box sx = { { height : '5em' , display : 'flex' , alignItems : 'center' , justifyContent : 'center' } } > < CircularProgress size = { 24 } /> </ Box > } >
27- < Box sx = { { display : 'flex' , alignItems : 'center' , width : '100%' } } >
28- { isDarkMode ? < LazyDarkLogo /> : < LazyLightLogo /> }
29- </ Box >
30- </ Suspense >
31- ) ;
32- }
33-
3415export const client = createDockerDesktopClient ( ) ;
3516
3617const DEFAULT_SETTINGS = {
@@ -112,7 +93,7 @@ function AppContent({ settings, setSettings, configuringItem, setConfiguringItem
11293 </ Paper >
11394 ) ;
11495 }
115-
96+ const isDataFetching = imagesIsFetching || secretsLoading || catalogLoading || registryLoading || mcpFetching ;
11697 return (
11798 < >
11899 { settings . showModal && (
@@ -147,39 +128,10 @@ function AppContent({ settings, setSettings, configuringItem, setConfiguringItem
147128 />
148129 ) }
149130
150- { /* Show a small loading indicator in the corner during background refetching */ }
151- { ( imagesIsFetching || secretsLoading || catalogLoading || registryLoading || mcpFetching ) && (
152- < Box
153- sx = { {
154- position : 'fixed' ,
155- bottom : 16 ,
156- right : 16 ,
157- zIndex : 9999 ,
158- display : 'flex' ,
159- alignItems : 'center' ,
160- backgroundColor : 'background.paper' ,
161- borderRadius : 2 ,
162- padding : 1 ,
163- boxShadow : 3
164- } }
165- >
166- < CircularProgress size = { 20 } sx = { { mr : 1 } } />
167- < Typography variant = "caption" > Refreshing data...</ Typography >
168- </ Box >
169- ) }
170-
171- < Stack direction = "column" spacing = { 1 } justifyContent = 'center' alignItems = 'center' >
172- < Stack direction = "row" spacing = { 1 } justifyContent = 'space-evenly' alignItems = 'center' sx = { { width : '100%' , maxWidth : '1000px' } } >
173- < Logo />
174- < IconButton sx = { { ml : 2 , alignSelf : 'flex-end' , justifyContent : 'flex-end' } } onClick = { ( ) => setSettings ( { ...settings , showModal : true } ) } >
175- < SettingsIcon sx = { { fontSize : '1.5em' } } />
176- </ IconButton >
177- </ Stack >
178- < CatalogGrid
179- setConfiguringItem = { setConfiguringItem }
180- showSettings = { ( ) => setSettings ( { ...settings , showModal : true } ) }
181- />
182- </ Stack >
131+ < CatalogGrid
132+ setConfiguringItem = { setConfiguringItem }
133+ showSettings = { ( ) => setSettings ( { ...settings , showModal : true } ) }
134+ />
183135 </ >
184136 ) ;
185137}
0 commit comments