From 45a297a8e526094e8fce6e2c5c0fd89b381d1765 Mon Sep 17 00:00:00 2001 From: ewy Date: Tue, 14 Apr 2026 16:37:17 +0200 Subject: i have to commit at some point! --- menu/icon.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 menu/icon.go (limited to 'menu/icon.go') 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) +} -- cgit v1.3