Spaces:
Configuration error
Configuration error
Download frontend/src/components/features/terminal/terminal.tsx from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 748 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/components/features/terminal/terminal.tsx
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/src/components/features/terminal/terminal.tsx
-
curl -L -o terminal.tsx https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/components/features/terminal/terminal.tsx
748 Bytes
| import { useSelector } from "react-redux"; | |
| import { RootState } from "#/store"; | |
| import { useTerminal } from "#/hooks/use-terminal"; | |
| import "@xterm/xterm/css/xterm.css"; | |
| import { RUNTIME_INACTIVE_STATES } from "#/types/agent-state"; | |
| interface TerminalProps { | |
| secrets: string[]; | |
| } | |
| function Terminal({ secrets }: TerminalProps) { | |
| const { commands } = useSelector((state: RootState) => state.cmd); | |
| const { curAgentState } = useSelector((state: RootState) => state.agent); | |
| const ref = useTerminal({ | |
| commands, | |
| secrets, | |
| disabled: RUNTIME_INACTIVE_STATES.includes(curAgentState), | |
| }); | |
| return ( | |
| <div className="h-full p-2 min-h-0"> | |
| <div ref={ref} className="h-full w-full" /> | |
| </div> | |
| ); | |
| } | |
| export default Terminal; | |