local T=script.Parent.Parent local O=require(T.Constants)local a=require(T.Packages.Roact)local D=require(T.Packages.StudioComponents)local w=D.Widget local v=require(T.Components.App)local H=a.Component:extend("\077\097\105\110\080\108\117\103\105\110")function H.init(T)T:setEnabled(false)end function H.setEnabled(O,T)O:setState({Enabled=T})O.props.Button:SetActive(T)end function H.didMount(T)T.buttonClicked=T.props.Button.Click:Connect(function()T:setEnabled(not T.state.Enabled)end)end function H.willUnmount(T)T.buttonClicked:Disconnect()end function H.render(T)return T.state.Enabled and a.createElement(w,{Id=O.MainWidgetId;Name=O.MainWidgetId;Title="\067\111\108\108\105\115\105\111\110 \071\114\111\117\112\115";InitialDockState=Enum.InitialDockState.Float;MinimumWindowSize=Vector2.new(220,175);OnClosed=function()T:setEnabled(false)end},{App=a.createElement(v)})end return H
local Plugin = script.Parent.Parent
local Constants = require(Plugin.Constants)

local Roact = require(Plugin.Packages.Roact)
local StudioComponents = require(Plugin.Packages.StudioComponents)

local Widget = StudioComponents.Widget
local App = require(Plugin.Components.App)

local MainPlugin = Roact.Component:extend("MainPlugin")

function MainPlugin:init()
	self:setEnabled(false)
end

function MainPlugin:setEnabled(enabled)
	self:setState({ Enabled = enabled })
	self.props.Button:SetActive(enabled)
end

function MainPlugin:didMount()
	self.buttonClicked = self.props.Button.Click:Connect(function()
		self:setEnabled(not self.state.Enabled)
	end)
end

function MainPlugin:willUnmount()
	self.buttonClicked:Disconnect()
end

function MainPlugin:render()
	return self.state.Enabled
		and Roact.createElement(Widget, {
			Id = Constants.MainWidgetId,
			Name = Constants.MainWidgetId,
			Title = "Collision Groups",
			InitialDockState = Enum.InitialDockState.Float,
			MinimumWindowSize = Vector2.new(220, 175),
			OnClosed = function()
				self:setEnabled(false)
			end,
		}, {
			App = Roact.createElement(App),
		})
end

return MainPlugin
