blob: 2043731d7145a85d5c75298e7ea7a9da5ee9219b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package menu
import (
"github.com/charmbracelet/lipgloss"
"github.com/ewy1/pik/menu/style"
"strings"
)
var (
IconStyle = style.New(func() lipgloss.Style {
st := lipgloss.NewStyle().Width(2).Height(1)
return st
})
)
func Icon(input string) string {
if strings.TrimSpace(input) == "" {
return ""
}
return IconStyle.Render(input)
}
func PaddedIcon(input string) string {
if strings.TrimSpace(input) == "" {
return Icon(" ")
}
return Icon(input)
}
|