Some checks failed
Release Binaries / release (push) Has been cancelled
Features: - Binary-Free Mode: No OpenCode binary required - NomadArch Native mode with free Zen models - Native session management - Provider routing (Zen, Qwen, Z.AI) - Fixed MCP connection with explicit connectAll() - Updated installers and launchers for all platforms - UI binary selector with Native option Free Models Available: - GPT-5 Nano (400K context) - Grok Code Fast 1 (256K context) - GLM-4.7 (205K context) - Doubao Seed Code (256K context) - Big Pickle (200K context)
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import { Component, For } from "solid-js"
|
|
import { formatShortcut, isMac } from "../lib/keyboard-utils"
|
|
import type { KeyboardShortcut } from "../lib/keyboard-registry"
|
|
import Kbd from "./kbd"
|
|
import HintRow from "./hint-row"
|
|
|
|
const KeyboardHint: Component<{
|
|
shortcuts: KeyboardShortcut[]
|
|
separator?: string
|
|
showDescription?: boolean
|
|
}> = (props) => {
|
|
function buildShortcutString(shortcut: KeyboardShortcut): string {
|
|
const parts: string[] = []
|
|
|
|
if (shortcut.modifiers.ctrl || shortcut.modifiers.meta) {
|
|
parts.push("cmd")
|
|
}
|
|
if (shortcut.modifiers.shift) {
|
|
parts.push("shift")
|
|
}
|
|
if (shortcut.modifiers.alt) {
|
|
parts.push("alt")
|
|
}
|
|
parts.push(shortcut.key)
|
|
|
|
return parts.join("+")
|
|
}
|
|
|
|
return (
|
|
<HintRow>
|
|
<For each={props.shortcuts}>
|
|
{(shortcut, i) => (
|
|
<>
|
|
{i() > 0 && <span class="mx-1">{props.separator || "•"}</span>}
|
|
{props.showDescription !== false && <span class="mr-1">{shortcut.description}</span>}
|
|
<Kbd shortcut={buildShortcutString(shortcut)} />
|
|
</>
|
|
)}
|
|
</For>
|
|
</HintRow>
|
|
)
|
|
}
|
|
|
|
export default KeyboardHint
|