Spaces:
Running
Running
Aakarsh2007
feat(ui): ActionPanel with quick commands, WorkspacePanel file browser, AgentSwarmPanel activity log
7a2d622 Download ui/src/components/WorkspacePanel.tsx from aakarsh2007/infraMind: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/spaces/aakarsh2007/infraMind/resolve/main/ui/src/components/WorkspacePanel.tsx
- Command line
-
hf download hf://spaces/aakarsh2007/infraMind/ui/src/components/WorkspacePanel.tsx
-
curl -L -o WorkspacePanel.tsx https://huggingface.co/spaces/aakarsh2007/infraMind/resolve/main/ui/src/components/WorkspacePanel.tsx
1.15 kB
| import React from 'react' | |
| import type { Observation } from '../types' | |
| import { panelStyle, titleStyle } from '../App' | |
| interface Props { obs: Observation | null } | |
| const fileIcon = (f: string) => f.endsWith('.js') ? '๐จ' : f.endsWith('.ts') ? '๐ท' : f.endsWith('.json') ? '๐' : f.endsWith('.yml') || f.endsWith('.yaml') ? 'โ๏ธ' : '๐' | |
| export function WorkspacePanel({ obs }: Props) { | |
| if (!obs || obs.available_files.length === 0) return null | |
| return ( | |
| <div style={panelStyle}> | |
| <div style={titleStyle}>๐ Workspace Files</div> | |
| {obs.available_files.map(f => ( | |
| <div key={f} style={{ display: 'flex', alignItems: 'center', gap: '0.4rem', padding: '0.3rem 0.4rem', borderRadius: '0.3rem', cursor: 'pointer', transition: 'background 0.1s' }} | |
| onMouseEnter={e => (e.currentTarget.style.background = '#1e2d4a')} | |
| onMouseLeave={e => (e.currentTarget.style.background = 'transparent')}> | |
| <span style={{ fontSize: '0.75rem' }}>{fileIcon(f)}</span> | |
| <span style={{ fontSize: '0.72rem', color: '#60a5fa', fontFamily: 'monospace' }}>{f}</span> | |
| </div> | |
| ))} | |
| </div> | |
| ) | |
| } | |