Files
openclaw/src/terminal/prompt-select-styled.ts
2026-02-18 17:48:02 +00:00

13 lines
410 B
TypeScript

import { select } from "@clack/prompts";
import { stylePromptHint, stylePromptMessage } from "./prompt-style.js";
export function selectStyled<T>(params: Parameters<typeof select<T>>[0]) {
return select({
...params,
message: stylePromptMessage(params.message),
options: params.options.map((opt) =>
opt.hint === undefined ? opt : { ...opt, hint: stylePromptHint(opt.hint) },
),
});
}