fix: allow to use empty style properly

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker
2024-12-04 16:40:31 -03:00
parent e5296a2b0f
commit f54c6d955f
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -1162,7 +1162,7 @@ func (m Model) statusView() string {
}
} else if len(m.items) == 0 {
// Not filtering: no items.
status = m.Styles.StatusEmpty.Render("No " + m.itemNamePlural)
status = m.Styles.StatusEmpty.Render()
} else {
// Normal
filtered := m.FilterState() == FilterApplied
@@ -1217,7 +1217,7 @@ func (m Model) populatedView() string {
if m.filterState == Filtering {
return ""
}
return m.Styles.NoItems.Render("No " + m.itemNamePlural + ".")
return m.Styles.NoItems.Render()
}
if len(items) > 0 {
+2 -1
View File
@@ -67,7 +67,8 @@ func DefaultStyles() (s Styles) {
Foreground(lipgloss.AdaptiveColor{Light: "#A49FA5", Dark: "#777777"}).
Padding(0, 0, 1, 2) //nolint:mnd
s.StatusEmpty = lipgloss.NewStyle().Foreground(subduedColor)
s.StatusEmpty = lipgloss.NewStyle().Foreground(subduedColor).
SetString("No items.")
s.StatusBarActiveFilter = lipgloss.NewStyle().
Foreground(lipgloss.AdaptiveColor{Light: "#1a1a1a", Dark: "#dddddd"})