MCPcopy Index your code
hub / github.com/Effect-TS/effect / renderToggle

Function renderToggle

packages/cli/src/internal/prompt/toggle.ts:32–46  ·  view source on GitHub ↗
(
  value: boolean,
  options: ToggleOptions,
  submitted: boolean = false
)

Source from the content-addressed store, hash-verified

30}
31
32function renderToggle(
33 value: boolean,
34 options: ToggleOptions,
35 submitted: boolean = false
36) {
37 const separator = Doc.annotate(Doc.char("/"), Ansi.blackBright)
38 const selectedAnnotation = Ansi.combine(Ansi.underlined, submitted ? Ansi.white : Ansi.cyanBright)
39 const inactive = value
40 ? Doc.text(options.inactive)
41 : Doc.annotate(Doc.text(options.inactive), selectedAnnotation)
42 const active = value
43 ? Doc.annotate(Doc.text(options.active), selectedAnnotation)
44 : Doc.text(options.active)
45 return Doc.hsep([active, separator, inactive])
46}
47
48function renderOutput(
49 toggle: Doc.AnsiDoc,

Callers 2

renderNextFrameFunction · 0.85
renderSubmissionFunction · 0.85

Calls 3

annotateMethod · 0.65
combineMethod · 0.65
textMethod · 0.45

Tested by

no test coverage detected