diff options
Diffstat (limited to 'termui/help_bar.go')
-rw-r--r-- | termui/help_bar.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/termui/help_bar.go b/termui/help_bar.go new file mode 100644 index 00000000..eb6facb6 --- /dev/null +++ b/termui/help_bar.go @@ -0,0 +1,24 @@ +package termui + +import ( + "fmt" + "strings" + + "github.com/MichaelMure/git-bug/util/colors" +) + +type helpBar []struct { + keys string + text string +} + +func (hb helpBar) Render() string { + var builder strings.Builder + for i, entry := range hb { + if i != 0 { + builder.WriteByte(' ') + } + builder.WriteString(colors.BlueBg(fmt.Sprintf("[%s] %s", entry.keys, entry.text))) + } + return builder.String() +} |