local JewelryTipsCell = class("JewelryTipsCell", BaseCell)

function JewelryTipsCell:refresh(data)
	local uiMap = self:getUIMap()
	local icon = uiMap["qlt_skill_desc_cell.icon"]
	local desc = uiMap["qlt_skill_desc_cell.desc"]
	local lvTx = uiMap["qlt_skill_desc_cell.icon.lv_tx"]

	if data.isLegend then
		desc:setAnchoredPositionX(54)
		icon:setVisible(true)

		if data.qlt == GConst.JewelryConst.MAX_SKILL then
			icon:setSprite(GConst.ATLAS_PATH.UI_EQUIP, "equip_activation_6")
		else
			icon:setSprite(GConst.ATLAS_PATH.UI_EQUIP, "equip_activation_5")
		end
	else
		desc:setAnchoredPositionX(13)
		icon:setVisible(false)
	end

	data.desc = data.desc or ""
	if data.unlock then
		local str = string.format("<color=#7136C6>%s</color>", data.desc)
		desc:setText(str)
	else
		local str = string.format("<color=#7B7E9B>%s</color>", data.desc)
		desc:setText(str)
	end

	lvTx:setText(data.qlt)
	self:getBaseObject():setSizeDeltaY(desc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredHeight + 4)
end

return JewelryTipsCell