GHHG10/CodeServer / opencode /packages /tui /src /ui /dialog-help.tsx
GHHG10's picture
download
raw
1.4 kB
import { TextAttributes } from "@opentui/core"
import { useTheme } from "../context/theme"
import { useDialog } from "./dialog"
import { useBindings, useCommandShortcut } from "../keymap"
export function DialogHelp() {
const dialog = useDialog()
const { theme } = useTheme()
const commandShortcut = useCommandShortcut("command.palette.show")
useBindings(() => ({
bindings: [
{ key: "return", desc: "Close help", group: "Dialog", cmd: () => dialog.clear() },
{ key: "escape", desc: "Close help", group: "Dialog", cmd: () => dialog.clear() },
],
}))
return (
<box paddingLeft={2} paddingRight={2} gap={1}>
<box flexDirection="row" justifyContent="space-between">
<text attributes={TextAttributes.BOLD} fg={theme.text}>
Help
</text>
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
esc/enter
</text>
</box>
<box paddingBottom={1}>
<text fg={theme.textMuted}>
Press {commandShortcut()} to see all available actions and commands in any context.
</text>
</box>
<box flexDirection="row" justifyContent="flex-end" paddingBottom={1}>
<box paddingLeft={3} paddingRight={3} backgroundColor={theme.primary} onMouseUp={() => dialog.clear()}>
<text fg={theme.selectedListItemText}>ok</text>
</box>
</box>
</box>
)
}

Xet Storage Details

Size:
1.4 kB
·
Xet hash:
15c62f08f2f45ba47368a4c515f8c0ac38fb062890b55c531bf9f81349654a94

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.