// DragonX Wallet - ImGui Edition
// Copyright 2024-2026 The Hush Developers
// Released under the GPLv3

#pragma once

#include <string>
#include <vector>

namespace dragonx {
class App;

namespace ui {

// A single balance layout entry read from ui.toml
struct BalanceLayoutEntry {
    std::string id;    // e.g. "classic", "donut", "minimal"
    std::string name;  // Display name, e.g. "Classic", "Donut Chart"
    bool enabled = true; // Whether this layout appears in the settings dropdown
};

// Get the list of available balance layouts (parsed from ui.toml).
// On first call (or after RefreshBalanceLayoutConfig()), parses the
// "tabs.balance.layouts.options" array from the schema.
const std::vector<BalanceLayoutEntry>& GetBalanceLayouts();

// Get the default layout ID from ui.toml ("tabs.balance.layouts.default").
const std::string& GetDefaultBalanceLayout();

// Re-read layout config from schema (call after theme/skin hot-reload).
void RefreshBalanceLayoutConfig();

// Legacy int-to-string migration for old settings.json files.
// Maps BalanceLayout enum ordinals (0-8) to their string IDs.
std::string MigrateBalanceLayoutIndex(int index);

/**
 * @brief Render the Balance tab
 * Shows balance summary and address list.
 * Dispatches to the selected layout from Settings.
 */
void RenderBalanceTab(App* app);

} // namespace ui
} // namespace dragonx
