( value: boolean, options: ToggleOptions, submitted: boolean = false )
| 30 | } |
| 31 | |
| 32 | function 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 | |
| 48 | function renderOutput( |
| 49 | toggle: Doc.AnsiDoc, |
no test coverage detected