diff --git a/apps/playground/src/components/sidebar/ToolsSidebar.tsx b/apps/playground/src/components/sidebar/ToolsSidebar.tsx index 34687ef..30fac3a 100644 --- a/apps/playground/src/components/sidebar/ToolsSidebar.tsx +++ b/apps/playground/src/components/sidebar/ToolsSidebar.tsx @@ -6,17 +6,23 @@ import { Input } from '@tpmjs/ui/Input/Input'; import { useEffect, useState } from 'react'; interface Tool { + toolId?: string; packageName: string; exportName: string; description: string; category: string; version: string; + qualityScore?: number; + frameworks?: string[]; + env?: Record; + importUrl?: string; } export function ToolsSidebar(): React.ReactElement { const [tools, setTools] = useState([]); const [loading, setLoading] = useState(true); const [filter, setFilter] = useState(''); + const [selectedTool, setSelectedTool] = useState(null); useEffect(() => { async function fetchTools() { @@ -44,49 +50,178 @@ export function ToolsSidebar(): React.ReactElement { ); return ( - + + {/* Tool Details Modal */} + {selectedTool && ( + {/* biome-ignore lint/a11y/useSemanticElements: Modal backdrop - standard pattern for modal overlays with role=button */} +
setSelectedTool(null)} + onKeyDown={(e) => { + if (e.key === 'Escape') setSelectedTool(null); + }} + role="button" + tabIndex={0} + aria-label="Close modal" + > + {/* biome-ignore lint/a11y/useKeyWithClickEvents: Modal content - prevents click-through to backdrop */} +
e.stopPropagation()} + > + {/* Close button */} + + + {/* Tool header */} +
+

{selectedTool.exportName}

+

{selectedTool.packageName}

+
+ {selectedTool.category} + v{selectedTool.version} + {selectedTool.qualityScore && ( + + Score: {(selectedTool.qualityScore * 100).toFixed(0)}% + + )} +
+
+ + {/* Description */} +
+

Description

+

{selectedTool.description}

+
+ + {/* Frameworks */} + {selectedTool.frameworks && selectedTool.frameworks.length > 0 && ( +
+

Frameworks

+
+ {selectedTool.frameworks.map((framework) => ( + + {framework} + + ))} +
+
+ )} + + {/* Environment Variables */} + {selectedTool.env && Object.keys(selectedTool.env).length > 0 && ( +
+

+ Environment Variables +

+
+ {Object.entries(selectedTool.env).map(([key, config]) => ( +
+
+ {key} + {config.required && ( + + Required + + )} +
+

{config.description}

+
+ ))} +
+
+ )} + + {/* Import URL */} + {selectedTool.importUrl && ( +
+

Import URL

+ + {selectedTool.importUrl} + +
+ )} + + {/* Tool ID */} + {selectedTool.toolId && ( +
+

Tool ID

+ + {selectedTool.toolId} + +
+ )} +
+
+ )} + ); }