MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / GetStatusEmoji

Function GetStatusEmoji

internal/ui/utils/formatting.go:134–147  ·  view source on GitHub ↗

GetStatusEmoji returns the appropriate status emoji or text based on showIcons flag.

(status string, showIcons bool)

Source from the content-addressed store, hash-verified

132
133// GetStatusEmoji returns the appropriate status emoji or text based on showIcons flag.
134func GetStatusEmoji(status string, showIcons bool) string {
135 if !showIcons {
136 return ""
137 }
138
139 switch strings.ToLower(status) {
140 case statusRunning, statusOnline:
141 return "🟢"
142 case statusStopped, statusOffline:
143 return "🔴"
144 default:
145 return "🟡"
146 }
147}
148
149// CalculatePercentage safely calculates percentage from used and total values
150// Returns 0.0 if total is 0 to avoid division by zero.

Callers 2

UpdateMethod · 0.92
UpdateMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected