--[[
	Helper function that should only be used in tests for the Grid component.
]]


local Roact = require(script.Parent.Parent.Parent.Parent.Roact)

local ITEM_HEIGHT = 100 -- px

local COLORS = {
	Color3.fromRGB(255, 0, 0),
	Color3.fromRGB(0, 255, 0),
	Color3.fromRGB(0, 0, 255),
	Color3.fromRGB(255, 255, 0),
	Color3.fromRGB(255, 0, 255),
	Color3.fromRGB(0, 255, 255),
}

local function getNextColor(index: number): Color3
	while index > #COLORS do
		index = index - #COLORS
	end
	return COLORS[index]
end

local function createGridItems(numItems: number): { any }
	local items = {}

	for i = 1, numItems do
		table.insert(
			items,
			Roact.createElement("Frame", {
				Size = UDim2.new(1, 0, 0, ITEM_HEIGHT),
				BackgroundColor3 = getNextColor(i),
			})
		)
	end

	return items
end

return createGridItems
