GuildHelper = GuildHelper or {}

local addon = GuildHelper

addon.NewUIRoot = addon.NewUIRoot or {}

local root = addon.NewUIRoot

function root:RenderHome(snapshot)
    if not self.contentHost then
        return nil
    end

    if addon.RosterService and addon.RosterService.RefreshCurrentPlayerReadiness then
        addon.RosterService:RefreshCurrentPlayerReadiness()
    end

    if addon.NewUIHome and addon.NewUIHome.Render then
        return addon.NewUIHome:Render(self.contentHost, snapshot)
    end

    return nil
end

function root:RenderNews(snapshot)
    if not self.contentHost then
        return nil
    end

    if addon.NewUINews and addon.NewUINews.Render then
        return addon.NewUINews:Render(self.contentHost, snapshot)
    end

    return nil
end

function root:RenderGroups(snapshot)
    if not self.contentHost then
        return nil
    end

    if addon.NewUIGroups and addon.NewUIGroups.Render then
        return addon.NewUIGroups:Render(self.contentHost, snapshot)
    end

    return nil
end

function root:RenderMyToons(snapshot)
    if not self.contentHost then
        return nil
    end

    if addon.NewUIMyToons and addon.NewUIMyToons.Render then
        return addon.NewUIMyToons:Render(self.contentHost, snapshot)
    end

    return nil
end

function root:RenderRoster(snapshot)
    if not self.contentHost then
        return nil
    end

    if addon.NewUIRoster and addon.NewUIRoster.Render then
        return addon.NewUIRoster:Render(self.contentHost, snapshot)
    end

    return nil
end

function root:RenderMythicPlus(snapshot)
    if not self.contentHost then
        return nil
    end

    if addon.NewUIMythicPlus and addon.NewUIMythicPlus.Render then
        return addon.NewUIMythicPlus:Render(self.contentHost, snapshot)
    end

    return nil
end

function root:RenderBIS(snapshot)
    if not self.contentHost then
        return nil
    end

    if addon.NewUIBIS and addon.NewUIBIS.Render then
        return addon.NewUIBIS:Render(self.contentHost, snapshot)
    end

    return nil
end

function root:RenderRaidBingo(snapshot)
    if not self.contentHost then
        return nil
    end

    if addon.NewUIRaidBingo and addon.NewUIRaidBingo.Render then
        return addon.NewUIRaidBingo:Render(self.contentHost, snapshot)
    end

    return nil
end

function root:RenderCelebrate(snapshot)
    if not self.contentHost then
        return nil
    end

    if addon.NewUICelebrate and addon.NewUICelebrate.Render then
        return addon.NewUICelebrate:Render(self.contentHost, snapshot)
    end

    return nil
end

function root:RenderSettings(snapshot)
    if not self.contentHost then
        return nil
    end

    if addon.NewUISettings and addon.NewUISettings.Render then
        return addon.NewUISettings:Render(self.contentHost, snapshot)
    end

    return nil
end

return root