package formatter import ( "fmt" "git.db.org.ai/dborg/internal/models" "git.db.org.ai/dborg/internal/utils" "strings" ) func FormatCryptoResults(response *models.CryptoResponse, asJSON bool) error { if asJSON { return utils.PrintJSON(response) } PrintSection(fmt.Sprintf("📊 Crypto Analysis Results")) if response.Query != "" { fmt.Printf("%s: %s\n\n", Cyan("Query"), response.Query) } if response.Response != "" { fmt.Println(response.Response) fmt.Println() } PrintDivider() fmt.Printf("%s: ", Cyan("Credits Remaining")) if response.Credits.Unlimited { fmt.Printf("%s\n", Green("Unlimited")) } else { fmt.Printf("%s\n", FormatCredits(int64(response.Credits.Remaining))) } if response.Message != "" && !strings.Contains(strings.ToLower(response.Message), "success") { fmt.Printf("\n%s: %s\n", Yellow("Message"), response.Message) } return nil }