Download packages/app/src/components/prompt-input/placeholder.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 926 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/src/components/prompt-input/placeholder.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/app/src/components/prompt-input/placeholder.ts
-
curl -L -o placeholder.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/src/components/prompt-input/placeholder.ts
926 Bytes
| type PromptPlaceholderInput = { | |
| mode: "normal" | "shell" | |
| commentCount: number | |
| example: string | |
| suggest: boolean | |
| t: (key: string, params?: Record<string, string>) => string | |
| } | |
| export function promptPlaceholder(input: PromptPlaceholderInput) { | |
| if (input.mode === "shell") return input.t("prompt.placeholder.shell", { example: input.example }) | |
| if (input.commentCount > 1) return input.t("prompt.placeholder.summarizeComments") | |
| if (input.commentCount === 1) return input.t("prompt.placeholder.summarizeComment") | |
| if (!input.suggest) return input.t("prompt.placeholder.simple") | |
| return input.t("prompt.placeholder.normal", { example: input.example }) | |
| } | |
| export function promptDesignPlaceholder( | |
| mode: PromptPlaceholderInput["mode"], | |
| placeholder: string, | |
| t: PromptPlaceholderInput["t"], | |
| ) { | |
| if (mode === "shell") return placeholder | |
| return t("ui.promptInput.placeholder.normal", { slash: "/", at: "@" }) | |
| } | |