|
1 | | -import React, { Suspense, useEffect, useState } from 'react'; |
2 | | -import { IconButton, Alert, AlertTitle, Stack, Button, Typography, FormGroup, FormControlLabel, Dialog, DialogTitle, DialogContent, Checkbox, Badge, TextField, Tabs, Tab, CircularProgress, Box, Menu, Divider, Switch, MenuItem } from '@mui/material'; |
3 | | -import { SwapVert, FolderOpenRounded } from '@mui/icons-material'; |
4 | 1 | import { createDockerDesktopClient } from '@docker/extension-api-client'; |
5 | 2 | import { ExecResult } from '@docker/extension-api-client-types/dist/v0'; |
6 | | -import YourClients from './tabs/YourClients'; |
7 | | -import { CatalogItemRichened } from '../types/catalog'; |
| 3 | +import { FolderOpenRounded } from '@mui/icons-material'; |
| 4 | +import { Alert, AlertTitle, Badge, Box, Button, Checkbox, CircularProgress, Dialog, DialogContent, DialogTitle, FormControlLabel, FormGroup, Stack, Switch, Tab, Tabs, TextField, Typography } from '@mui/material'; |
| 5 | +import React, { Suspense, useEffect, useState } from 'react'; |
8 | 6 | import { CATALOG_LAYOUT_SX } from '../Constants'; |
9 | 7 | import { MCPClientState } from '../MCPClients'; |
| 8 | +import { CatalogItemRichened } from '../types/catalog'; |
| 9 | +import YourClients from './tabs/YourClients'; |
10 | 10 |
|
11 | 11 | const ToolCatalog = React.lazy(() => import('./tabs/ToolCatalog')); |
12 | 12 |
|
@@ -42,11 +42,6 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({ |
42 | 42 | const [search, setSearch] = useState<string>(''); |
43 | 43 | const [tab, setTab] = useState<number>(0); |
44 | 44 | const [ddVersion, setDdVersion] = useState<{ version: string, build: number } | null>(null); |
45 | | - const [openMenus, setOpenMenus] = useState<{ [key: string]: { anchorEl: HTMLElement | null, open: boolean } }>({ |
46 | | - 'demo-customized-menu': { anchorEl: null, open: false } |
47 | | - }); |
48 | | - |
49 | | - const [sort, setSort] = useState<'name-asc' | 'name-desc' | 'date-asc' | 'date-desc'>('date-desc'); |
50 | 45 | const [showMine, setShowMine] = useState<boolean>(localStorage.getItem('showMine') === 'true'); |
51 | 46 |
|
52 | 47 | const loadDDVersion = async () => { |
@@ -134,51 +129,12 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({ |
134 | 129 | <FormGroup> |
135 | 130 | <Stack direction="row" spacing={1} alignItems='center' justifyContent="space-evenly"> |
136 | 131 | <TextField label="Search" sx={{ width: 380 }} value={search} onChange={(e) => setSearch(e.target.value)} /> |
137 | | - <IconButton |
138 | | - id="demo-customized-button" |
139 | | - aria-controls={openMenus['demo-customized-menu'] ? 'demo-customized-menu' : undefined} |
140 | | - aria-haspopup="true" |
141 | | - aria-expanded={openMenus['demo-customized-menu'] ? 'true' : undefined} |
142 | | - onClick={(e) => setOpenMenus({ ...openMenus, 'demo-customized-menu': { anchorEl: e.currentTarget, open: !openMenus['demo-customized-menu'].open } })} |
143 | | - > |
144 | | - <SwapVert /> |
145 | | - </IconButton> |
146 | 132 | <FormControlLabel control={<Switch checked={showMine} onChange={(e) => { |
147 | 133 | setShowMine(e.target.checked) |
148 | 134 | localStorage.setItem('showMine', e.target.checked.toString()) |
149 | 135 | }} />} label="Show only enabled tools" /> |
150 | 136 | </Stack> |
151 | 137 | </FormGroup> |
152 | | - |
153 | | - <Menu |
154 | | - id="demo-customized-menu" |
155 | | - MenuListProps={{ |
156 | | - 'aria-labelledby': 'demo-customized-button', |
157 | | - }} |
158 | | - anchorEl={openMenus['demo-customized-menu'].anchorEl || undefined} |
159 | | - open={openMenus['demo-customized-menu'].open} |
160 | | - onClose={() => setOpenMenus({ ...openMenus, 'demo-customized-menu': { anchorEl: null, open: false } })} |
161 | | - > |
162 | | - <MenuItem sx={{ fontWeight: sort === 'date-desc' ? 'bold' : 'normal' }} onClick={() => { |
163 | | - setOpenMenus({ ...openMenus, 'demo-customized-menu': { anchorEl: null, open: false } }) |
164 | | - setSort('date-desc') |
165 | | - }} disableRipple> |
166 | | - ⏰ Most Recent |
167 | | - </MenuItem> |
168 | | - <Divider sx={{ my: 0.5 }} /> |
169 | | - <MenuItem sx={{ fontWeight: sort === 'name-asc' ? 'bold' : 'normal' }} onClick={() => { |
170 | | - setOpenMenus({ ...openMenus, 'demo-customized-menu': { anchorEl: null, open: false } }) |
171 | | - setSort('name-asc') |
172 | | - }} disableRipple> |
173 | | - Name (A-Z) |
174 | | - </MenuItem> |
175 | | - <MenuItem sx={{ fontWeight: sort === 'name-desc' ? 'bold' : 'normal' }} onClick={() => { |
176 | | - setOpenMenus({ ...openMenus, 'demo-customized-menu': { anchorEl: null, open: false } }) |
177 | | - setSort('name-desc') |
178 | | - }} disableRipple> |
179 | | - Name (Z-A) |
180 | | - </MenuItem> |
181 | | - </Menu> |
182 | 138 | </Stack> |
183 | 139 | } |
184 | 140 |
|
|
0 commit comments