1
- import React , { useState , Suspense , useEffect } from 'react' ;
2
1
import { createDockerDesktopClient } from '@docker/extension-api-client' ;
3
- import { Typography , Button , IconButton , Alert , DialogTitle , Dialog , DialogContent , CircularProgress , Paper , Box , SvgIcon , useTheme } from '@mui/material' ;
4
- import { CatalogItemRichened } from './types/catalog' ;
5
- import { Close } from '@mui/icons-material' ;
2
+ import { useEffect } from 'react' ;
3
+
6
4
import { CatalogGrid } from './components/CatalogGrid' ;
7
- import { POLL_INTERVAL } from './Constants' ;
8
- import ConfigurationModal from './components/tile/Modal' ;
9
5
import LoadingState from './components/LoadingState' ;
10
6
import { useCatalogAll } from './queries/useCatalog' ;
11
- import { useRequiredImages } from './queries/useRequiredImages' ;
12
- import { useMCPClient } from './queries/useMCPClient' ;
13
7
import { useConfig } from './queries/useConfig' ;
8
+ import { useMCPClient } from './queries/useMCPClient' ;
9
+ import { useRequiredImages } from './queries/useRequiredImages' ;
14
10
import { useSecrets } from './queries/useSecrets' ;
15
- import { syncConfigWithRegistry , syncRegistryWithConfig } from './Registry' ;
11
+ import { syncRegistryWithConfig } from './Registry' ;
16
12
17
13
export const client = createDockerDesktopClient ( ) ;
18
14
19
- const DEFAULT_SETTINGS = {
20
- showModal : false ,
21
- pollIntervalSeconds : POLL_INTERVAL / 1000
22
- }
23
-
24
15
export function App ( ) {
25
- const [ settings , setSettings ] = useState < { showModal : boolean , pollIntervalSeconds : number } > ( localStorage . getItem ( 'settings' ) ? JSON . parse ( localStorage . getItem ( 'settings' ) || '{}' ) : DEFAULT_SETTINGS ) ;
26
- const [ configuringItem , setConfiguringItem ] = useState < CatalogItemRichened | null > ( null ) ;
27
-
28
16
// Use hooks directly in the component
29
17
const catalogAll = useCatalogAll ( client ) ;
30
18
const requiredImages = useRequiredImages ( client ) ;
@@ -44,17 +32,17 @@ export function App() {
44
32
...mcpClient ,
45
33
46
34
// Config props
47
- ...config
35
+ ...config ,
48
36
} ;
49
37
50
- const isLoading = catalogAll . catalogLoading ||
38
+ const isLoading =
39
+ catalogAll . catalogLoading ||
51
40
catalogAll . registryLoading ||
52
41
requiredImages . isLoading ||
53
42
secrets . isLoading ;
54
43
55
44
useEffect ( ( ) => {
56
45
if ( config . config && catalogAll . registryItems ) {
57
- console . log ( 'registryItems' , catalogAll . registryItems )
58
46
syncRegistryWithConfig ( client , catalogAll . registryItems , config . config ) ;
59
47
}
60
48
} , [ config . config ] ) ;
@@ -64,10 +52,8 @@ export function App() {
64
52
{ isLoading ? (
65
53
< LoadingState appProps = { appProps } />
66
54
) : (
67
- < CatalogGrid
68
- appProps = { appProps }
69
- />
55
+ < CatalogGrid appProps = { appProps } />
70
56
) }
71
57
</ >
72
58
) ;
73
- }
59
+ }
0 commit comments