lazygit/pkg/gui/presentation/loader.go
Stefan Haller 252dda5220 Move Loader to presentation package
It is very gui specific and shouldn't be in a low-level utils package.
2025-05-06 09:52:53 +02:00

14 lines
344 B
Go

package presentation
import (
"time"
"github.com/jesseduffield/lazygit/pkg/config"
)
// Loader dumps a string to be displayed as a loader
func Loader(now time.Time, config config.SpinnerConfig) string {
milliseconds := now.UnixMilli()
index := milliseconds / int64(config.Rate) % int64(len(config.Frames))
return config.Frames[index]
}