Skip to content

Commit b258870

Browse files
authored
Merge pull request #222 from dgageot/tools-table
Show the tools as a table
2 parents 2c8d8b1 + d502142 commit b258870

File tree

1 file changed

+46
-29
lines changed
  • src/extension/ui/src/components/tile

1 file changed

+46
-29
lines changed

src/extension/ui/src/components/tile/Modal.tsx

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@ import {
1818
IconButton,
1919
Link,
2020
OutlinedInput,
21+
Paper,
2122
Stack,
2223
Switch,
2324
Tab,
25+
Table,
26+
TableBody,
27+
TableCell,
28+
TableContainer,
29+
TableHead,
30+
TableRow,
2431
Tabs,
2532
TextField,
2633
Tooltip,
@@ -264,32 +271,41 @@ const ConfigurationModal = ({
264271
{!catalogItem?.tools?.length && (
265272
<Typography>No tools available for this item.</Typography>
266273
)}
267-
<Stack
268-
spacing={1}
269-
sx={{
270-
padding: 1,
271-
overflow: 'auto',
272-
height: 'calc(80vh - 200px)',
273-
minHeight: '180px',
274-
}}
275-
>
276-
{(catalogItem.tools || []).map((tool) => (
277-
<Typography
278-
key={tool.name}
279-
variant="body2"
280-
sx={toolChipStyle}
281-
>
282-
{tool.name}
283-
<Link
284-
onClick={() => client.host.openExternal(`${catalogItem.readme}#tool-${tool.name.replaceAll(' ', '-')}` || '')}
285-
href="#"
286-
target="_blank"
287-
>
288-
<Launch />
289-
</Link>
290-
</Typography>
291-
))}
292-
</Stack>
274+
<TableContainer component={Paper}>
275+
<Table>
276+
<TableHead>
277+
<TableRow>
278+
<TableCell>Name</TableCell>
279+
<TableCell></TableCell>
280+
</TableRow>
281+
</TableHead>
282+
<TableBody>
283+
{(catalogItem.tools || []).map((tool) => (
284+
<TableRow>
285+
<TableCell>
286+
<Typography
287+
key={tool.name}
288+
variant="body2"
289+
sx={toolChipStyle}
290+
>
291+
{tool.name}
292+
</Typography>
293+
</TableCell>
294+
<TableCell>
295+
<Link
296+
onClick={() => client.host.openExternal(`${catalogItem.readme}#tool-${tool.name.replaceAll(' ', '-')}` || '')}
297+
href="#"
298+
target="_blank"
299+
>
300+
Documentation
301+
<Launch />
302+
</Link>
303+
</TableCell>
304+
</TableRow>
305+
))}
306+
</TableBody>
307+
</Table>
308+
</TableContainer>
293309
</TabPanel>
294310
<TabPanel value={tabValue} index={1}>
295311
<Stack
@@ -401,9 +417,10 @@ const ConfigurationModal = ({
401417
</Stack>
402418
</TabPanel>
403419
</>
404-
)}
405-
</DialogContent>
406-
</Dialog>
420+
)
421+
}
422+
</DialogContent >
423+
</Dialog >
407424
);
408425
};
409426

0 commit comments

Comments
 (0)