local r=script.Parent.Parent.components local N=require(r.window.button)local j=require(r.window.section)local E=require(r.window.window)local L=script.Parent.Parent.packages local q=require(L.fusion)local v=require(L.states)local J=q.cleanup local V=q.ForPairs return{name="\109\111\100\117\108\101\115",description="\086\105\101\119 \097\108\108 \116\104\101 \109\111\100\117\108\101\115 \105\110 \116\104\101 \115\099\114\105\112\116",arguments={},callback=function()E({title="\077\111\100\117\108\101\115",size=UDim2.fromOffset(345,394)},{V(v.Commands,function(r,E)return r,j({text=E.name,subtext=E.description,newPage={q.Computed(function()if#E.arguments>0 then return V(E.arguments,function(r,j)return r,N({text="\065\114\103\117\109\101\110\116\058 "..j.name,subtext="\084\121\112\101\058 "..j.type})end,J)end return N({text="\067\111\109\109\097\110\100 \104\097\115 \110\111 \097\114\103\117\109\101\110\116\115\046",clickable=false})end,J)}})end,J)})end}
local Components = script.Parent.Parent.components
local Button = require(Components.window.button)
local Section = require(Components.window.section)
local Window = require(Components.window.window)

local Packages = script.Parent.Parent.packages
local Fusion = require(Packages.fusion)
local States = require(Packages.states)

local Cleanup = Fusion.cleanup
local ForPairs = Fusion.ForPairs

return {
	name = "modules",
	description = "View all the modules in the script",
	arguments = {},

	callback = function()
		Window({
			title = "Modules",
			size = UDim2.fromOffset(345, 394),
		}, {
			ForPairs(States.Commands, function(index, value)
				return index,
					Section({
						text = value.name,
						subtext = value.description,
						newPage = {
							Fusion.Computed(function()
								if #value.arguments > 0 then
									return ForPairs(value.arguments, function(index2, argument)
										return index2,
											Button({
												text = "Argument: " .. argument.name,
												subtext = "Type: " .. argument.type,
											})
									end, Cleanup)
								end

								return Button({
									text = "Command has no arguments.",
									clickable = false,
								})
							end, Cleanup),
						},
					})
			end, Cleanup),
		})
	end,
}
