local TaskViewCell = class("TaskViewCell", BaseCell)

local STAR = {"dungeon_armor_star_1", "dungeon_armor_star_2"}

function TaskViewCell:refresh(taskId, done, reward)
    local uiMap = self:getUIMap()
    local desc = uiMap["task_view_cell.desc"]
    local i18config = I18N:getConfig("task_dungeon_armor")[taskId]
    if i18config then
        desc:setText(i18config.desc)
    else
        desc:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_ARMOR_DESC_7))
    end

    if not self.rewardCell then
        self.rewardCell = CellManager:addCellComp(uiMap["task_view_cell.reward_cell"], GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
    end
    self.rewardCell:refreshByConfig(reward)
    self.rewardCell:showMask(done == true, done == true)

    local starObj = uiMap["task_view_cell.star"]
    local star = STAR[2]
    if done then
        star = STAR[1]
    end
    starObj:setSprite(GConst.ATLAS_PATH.UI_DUGEON_ARMOR, star)
end

return TaskViewCell