#pragma once

#include "../core/LayerManager.h"
#include "../core/CommandHistory.h"
#include "IconManager.h"
#include <imgui.h>
#include <memory>
#include <string>

namespace UsdLayerManager {

class StageEditorPanel {
public:
    StageEditorPanel();
    ~StageEditorPanel();

    void SetLayerManager(LayerManager* manager) { m_layerManager = manager; }
    void SetCommandHistory(CommandHistory* history) { m_commandHistory = history; }
    void SetIconManager(IconManager* icons) { m_iconManager = icons; }
    void Render();

private:
    void RenderFixedLayers(const std::vector<LayerInfo>& layers);
    void RenderSublayerList(const std::vector<LayerInfo>& sublayers);
    void RenderSublayerContextMenu(int i, const std::vector<LayerInfo>& sublayers);

    LayerManager*   m_layerManager    = nullptr;
    CommandHistory* m_commandHistory  = nullptr;
    IconManager*    m_iconManager     = nullptr;
    int             m_selectedIdx     = -1;
};

} // namespace UsdLayerManager
