( value: boolean, options: ToggleOptionsReq, theme: Theme, submitted: boolean = false )
| 4041 | }) |
| 4042 | |
| 4043 | const renderToggle = ( |
| 4044 | value: boolean, |
| 4045 | options: ToggleOptionsReq, |
| 4046 | theme: Theme, |
| 4047 | submitted: boolean = false |
| 4048 | ) => { |
| 4049 | const separator = annotateSymbol(theme, theme.toggleSeparator, theme.mutedColor) |
| 4050 | const selectedAnnotation = Ansi.combine( |
| 4051 | Ansi.underlined, |
| 4052 | submitted ? theme.submittedColor : theme.primaryColor |
| 4053 | ) |
| 4054 | const inactive = value |
| 4055 | ? options.inactive |
| 4056 | : Ansi.annotate(theme.colors, options.inactive, selectedAnnotation) |
| 4057 | const active = value |
| 4058 | ? Ansi.annotate(theme.colors, options.active, selectedAnnotation) |
| 4059 | : options.active |
| 4060 | return active + " " + separateSymbol(separator, inactive) |
| 4061 | } |
| 4062 | |
| 4063 | const renderToggleNextFrame = Effect.fnUntraced(function*(state: ToggleState, options: ToggleOptionsReq) { |
| 4064 | const figures = yield* getTheme(options) |
no test coverage detected