#pragma once

#include "../CommandHistory.h"
#include <pxr/usd/usd/stage.h>
#include <pxr/usd/sdf/path.h>
#include <string>

namespace UsdLayerManager {

/// Renames a USD prim via UsdNamespaceEditor, updating all composition arcs.
/// Undo restores the original name.
class RenamePrimCommand : public ICommand {
public:
    RenamePrimCommand(pxr::UsdStageRefPtr stage,
                      const pxr::SdfPath& primPath,
                      const std::string&  newName);

    void Execute() override;
    void Undo()    override;
    std::string GetDescription() const override { return m_description; }

private:
    pxr::UsdStageRefPtr m_stage;
    pxr::SdfPath        m_oldPath;   ///< path before rename
    pxr::SdfPath        m_newPath;   ///< path after rename (set in Execute)
    std::string         m_oldName;
    std::string         m_newName;
    std::string         m_description;
};

} // namespace UsdLayerManager
