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

Function renderSubmission

packages/cli/src/internal/prompt/toggle.ts:87–102  ·  view source on GitHub ↗
(value: boolean, options: ToggleOptions)

Source from the content-addressed store, hash-verified

85}
86
87function renderSubmission(value: boolean, options: ToggleOptions) {
88 return Effect.gen(function*() {
89 const terminal = yield* Terminal.Terminal
90 const figures = yield* InternalAnsiUtils.figures
91 const columns = yield* terminal.columns
92 const leadingSymbol = Doc.annotate(figures.tick, Ansi.green)
93 const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.blackBright)
94 const toggle = renderToggle(value, options, true)
95 const promptMsg = renderOutput(toggle, leadingSymbol, trailingSymbol, options)
96 return promptMsg.pipe(
97 Doc.cat(Doc.hardLine),
98 Optimize.optimize(Optimize.Deep),
99 Doc.render({ style: "pretty", options: { lineWidth: columns } })
100 )
101 })
102}
103
104const activate = Effect.succeed(Action.NextFrame({ state: true }))
105const deactivate = Effect.succeed(Action.NextFrame({ state: false }))

Callers 1

handleRenderFunction · 0.70

Calls 4

renderToggleFunction · 0.85
renderOutputFunction · 0.70
annotateMethod · 0.65
pipeMethod · 0.65

Tested by

no test coverage detected