LDB  = LibStub("LibDataBroker-1.1")
LDBI = LibStub("LibDBIcon-1.0")

function ApplyMinimapVisibility()
    if G.minimap.hide then
        LDBI:Hide("Pedro")
		else
        LDBI:Show("Pedro")
	end
end

PedroLDB = LDB:NewDataObject("Pedro", {
    type  = "launcher",
    icon  = "Interface\\AddOns\\Pedro\\Media\\Pedro.tga",
    label = "Pedro",
	
    OnClick = function(_, button)
        if button == "LeftButton" then
            ShowPedroMainUI()
			elseif button == "RightButton" then
            SlashCmdList.PEDRODEBUG()
		end
	end,
	
    OnTooltipShow = function(tt)
        tt:AddLine("Pedro")
        tt:AddLine("Version: " .. ADDON_VERSION)
        tt:AddLine("Left-Click: Open Pedro UI")
        tt:AddLine("Right-Click: Debug Info")
	end,
})
