This commit is contained in:
@@ -58,14 +58,18 @@ var (
|
|||||||
stateUnknownStyle = lipgloss.NewStyle().Foreground(colorMuted)
|
stateUnknownStyle = lipgloss.NewStyle().Foreground(colorMuted)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// renderState returns a plain-text state label for use inside the
|
||||||
|
// bubbles table. The table truncates cells with runewidth.Truncate
|
||||||
|
// which counts the printable bytes of ANSI escape sequences toward
|
||||||
|
// column width, so a styled value gets chopped down to just "…".
|
||||||
func renderState(s string) string {
|
func renderState(s string) string {
|
||||||
switch s {
|
switch s {
|
||||||
case "up":
|
case "up":
|
||||||
return stateUpStyle.Render("● up")
|
return "● up"
|
||||||
case "down":
|
case "down":
|
||||||
return stateDownStyle.Render("● down")
|
return "● down"
|
||||||
default:
|
default:
|
||||||
return stateUnknownStyle.Render("○ unknown")
|
return "○ unknown"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user