Download packages/ui/src/v2/components/keybind-v2.tsx from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 778 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/ui/src/v2/components/keybind-v2.tsx
- Command line
-
hf download hf://SaylorTwift/opencode/packages/ui/src/v2/components/keybind-v2.tsx
-
curl -L -o keybind-v2.tsx https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/ui/src/v2/components/keybind-v2.tsx
778 Bytes
| import { type ComponentProps, For, splitProps } from "solid-js" | |
| import "./keybind-v2.css" | |
| export interface KeybindV2Props extends ComponentProps<"div"> { | |
| keys: string[] | |
| variant?: "neutral" | "ghost" | |
| } | |
| export function KeybindV2(props: KeybindV2Props) { | |
| const [local, rest] = splitProps(props, ["keys", "variant", "class", "classList"]) | |
| return ( | |
| <div | |
| {...rest} | |
| data-component="keybind-v2" | |
| data-variant={local.variant || "neutral"} | |
| classList={{ | |
| ...local.classList, | |
| [local.class ?? ""]: !!local.class, | |
| }} | |
| > | |
| <For each={local.keys}> | |
| {(key) => ( | |
| <div data-slot="keybind-v2-key"> | |
| <span data-slot="keybind-v2-label">{key}</span> | |
| </div> | |
| )} | |
| </For> | |
| </div> | |
| ) | |
| } | |