diff options
| author | ewy <ewy0@protonmail.com> | 2026-04-14 16:37:17 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-04-14 16:37:17 +0200 |
| commit | 45a297a8e526094e8fce6e2c5c0fd89b381d1765 (patch) | |
| tree | 852ebc3a0112c94dc9726d0b27ab057bf6383660 /menu/icon.go | |
i have to commit at some point!
Diffstat (limited to 'menu/icon.go')
| -rw-r--r-- | menu/icon.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/menu/icon.go b/menu/icon.go new file mode 100644 index 0000000..ec2135f --- /dev/null +++ b/menu/icon.go @@ -0,0 +1,28 @@ +package menu + +import ( + "github.com/charmbracelet/lipgloss" + "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) +} |
