(state: State, submitted: boolean = false)
| 72 | } |
| 73 | |
| 74 | function renderParts(state: State, submitted: boolean = false) { |
| 75 | return Arr.reduce( |
| 76 | state.dateParts, |
| 77 | Doc.empty as Doc.AnsiDoc, |
| 78 | (doc, part, currentIndex) => { |
| 79 | const partDoc = Doc.text(part.toString()) |
| 80 | if (currentIndex === state.cursor && !submitted) { |
| 81 | const annotation = Ansi.combine(Ansi.underlined, Ansi.cyanBright) |
| 82 | return Doc.cat(doc, Doc.annotate(partDoc, annotation)) |
| 83 | } |
| 84 | return Doc.cat(doc, partDoc) |
| 85 | } |
| 86 | ) |
| 87 | } |
| 88 | |
| 89 | function renderOutput( |
| 90 | leadingSymbol: Doc.AnsiDoc, |
no test coverage detected