// mode_enable — pure implementation. See mode_enable.h. NO REAPER / SWELL / LICE / vendor.

#include "mode_enable.h"

#include "view_mode_model.h"  // kArrangeModeId / kDesignModeId — the ONE home for the mode ids

namespace reasampler {

bool tagButtonEnabled(const std::string& activeModeId, TagTarget target) {
    // The target's own mode id, so the rule is a single "target != active" compare.
    const char* targetId =
        (target == TagTarget::Arrange) ? kArrangeModeId : kDesignModeId;

    // Fail-open on an unrecognized active id (neither seed mode): every button live, so a
    // future added mode never dead-locks the bar and the user can always reach the action.
    if (activeModeId != kArrangeModeId && activeModeId != kDesignModeId) return true;

    return activeModeId != targetId;
}

} // namespace reasampler
