-- << UPDATES >>

local displayNewUpdatesFor = 86400*10.5
local template1 = updatesFrame.Template
template1.Visible = false
function module:CreateUpdates()
	cf:ClearPage(updatesFrame)
	local totalLabels = 0
	for _, updateGroup in pairs(updates) do
		local updateTime = 0
		totalLabels = totalLabels + #updateGroup
		for i,v in pairs(updateGroup) do
			local label = template1:Clone()
			if i == 1 then
				updateTime = v[1]
				label.BackgroundColor3 = Color3.fromRGB(95, 95, 95)
				label.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
				label.TextLabel.Text = v[2]
			else
				label.BackgroundColor3 = cf:GetLabelBackgroundColor(i)
				label.TextLabel.TextColor3 = Color3.fromRGB(235, 235, 235)
				label.TextLabel.Text = v[1]
				if updateTime > os.time() - displayNewUpdatesFor then
					label.New.Visible = true
					label.TextLabel.Position = UDim2.new(0.16, 0,0.15, 0)
					label.TextLabel.Size = UDim2.new(0.8, 0,0.7, 0)
				end
			end
			label.Visible = true
			label.Parent = updatesFrame
		end
	end
	updatesFrame.CanvasSize = UDim2.new(0,0,0,totalLabels*template1.AbsoluteSize.Y)
end


