mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
25 lines
398 B
Go
25 lines
398 B
Go
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()
|
|
}
|