--[[
	@plugin UI
	
	Currently converts gui instances into PluginWidgets.
]]


local widget = {}

local plugin = nil

function widget.convertToDockWidget(screenGui, widgetId: string, widgetInfo: DockWidgetPluginGuiInfo, title: string)
	local widget = plugin:CreateDockWidgetPluginGui(widgetId, widgetInfo)
	widget.Title = title
	widget.ZIndexBehavior = screenGui.ZIndexBehavior
	
	screenGui = screenGui:GetChildren()
	
	for i = 1, #screenGui do
		screenGui[i]:Clone().Parent = widget
	end 
	
	return widget
end 

return function(Plugin: Plugin)
	plugin = Plugin
	return widget
end
