local q=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local Q=q:WaitForChild("\077\111\100\117\108\101\115")local R=((game:GetService("\083\116\097\114\116\101\114\080\108\097\121\101\114")):WaitForChild("\083\116\097\114\116\101\114\080\108\097\121\101\114\083\099\114\105\112\116\115")).clientSrc local j=require(Q.Roact)local E=require(Q.src.utils.SupportLibrary)local x=require(R.Components.common.ScrollingFrame)local F=j.createElement local function J(q)local Q=q.items or{}local R=q.rowComponent local J={}local S=E.Values(Q)for Q=1,#S,1 do local j=S[Q]J[Q]=F(R,E.Merge({item=j},q.rowProps or{}))end return F(x,{Layout="\084\097\098\108\101";LayoutDirection="\086\101\114\116\105\099\097\108";CanvasSize="\087\082\065\080\095\067\079\078\084\069\078\084";Size=UDim2.new(1,0,1,0),ScrollBarThickness=4;ScrollBarImageTransparency=.6,VerticalScrollBarInset="\083\099\114\111\108\108\066\097\114",BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1;BorderSizePixel=8;BorderMode=Enum.BorderMode.Inset,LayoutOrder=100,SortOrder=q.SortOrder;ElasticBehavior=Enum.ElasticBehavior.Always,[j.Children]=J})end return J
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Modules = ReplicatedStorage:WaitForChild('Modules')
-- local logger = require(Modules.src.utils.Logger)
local clientSrc = game:GetService('StarterPlayer'):WaitForChild('StarterPlayerScripts').clientSrc

local Roact = require(Modules.Roact)

local Support = require(Modules.src.utils.SupportLibrary)

local ScrollingFrame = require(clientSrc.Components.common.ScrollingFrame)

local createElement = Roact.createElement

local function DynamicTable(props)
	local items = props.items or {}
	local rowComponent = props.rowComponent

	local ListItems = {}

	local orderedItems = Support.Values(items)

	for i = 1, #orderedItems do
		local item = orderedItems[i]
		ListItems[i] = createElement(rowComponent, Support.Merge({ item = item }, props.rowProps or {}))
	end

	return createElement(ScrollingFrame, {
		Layout = 'Table',
		LayoutDirection = 'Vertical',
		CanvasSize = 'WRAP_CONTENT',
		Size = UDim2.new(1, 0, 1, 0),
		ScrollBarThickness = 4,
		ScrollBarImageTransparency = 0.6,
		VerticalScrollBarInset = 'ScrollBar',
		BackgroundColor3 = Color3.new(1, 1, 1),
		BackgroundTransparency = 1,
		BorderSizePixel = 8,
		BorderMode = Enum.BorderMode.Inset,
		LayoutOrder = 100,
		SortOrder = props.SortOrder,
		ElasticBehavior = Enum.ElasticBehavior.Always,
		[Roact.Children] = ListItems,
	})
end

return DynamicTable