Download packages/tui/src/component/workspace-label.tsx from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/component/workspace-label.tsx
- Command line
-
hf download hf://SaylorTwift/opencode/packages/tui/src/component/workspace-label.tsx
-
curl -L -o workspace-label.tsx https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/component/workspace-label.tsx
669 Bytes
| import { useTheme } from "../context/theme" | |
| export type WorkspaceStatus = "connected" | "connecting" | "disconnected" | "error" | |
| export function WorkspaceLabel(props: { type: string; name: string; status?: WorkspaceStatus; icon?: boolean }) { | |
| const { theme } = useTheme() | |
| const color = () => { | |
| if (props.status === "connected") return theme.success | |
| if (props.status === "error") return theme.error | |
| return theme.textMuted | |
| } | |
| return ( | |
| <> | |
| {props.icon ? <span style={{ fg: color() }}>● </span> : undefined} | |
| <span style={{ fg: theme.text }}>{props.name}</span> <span style={{ fg: theme.textMuted }}>({props.type})</span> | |
| </> | |
| ) | |
| } | |