local n=require((script:FindFirstAncestor("\077\097\122\101\071\101\110\101\114\097\116\111\114\080\108\117\103\105\110")).Roact)local Z=script:FindFirstAncestor("\080\108\117\103\105\110")local w=require(Z.Components.Theme)local i=require(Z.Components.Panel)local X=require(Z.Components.FitText)local G=require(Z.Components.FitScrollingFrame)local K=require(Z.Components.FormButton)local V=n.createElement local F=60 local y=8 local J=n.Component:extend("\069\114\114\111\114\080\097\110\101\108")function J.render(Z)local J=Z.props.errorMessage local v=Z.props.onDismiss return w.with(function(Z)return V(i,nil,{Layout=n.createElement("\085\073\076\105\115\116\076\097\121\111\117\116",{HorizontalAlignment=Enum.HorizontalAlignment.Center;VerticalAlignment=Enum.VerticalAlignment.Center;SortOrder=Enum.SortOrder.LayoutOrder,Padding=UDim.new(0,8)});ErrorContainer=V(G,{containerProps={BackgroundTransparency=1;BorderSizePixel=0,Size=UDim2.new(1,-y*2,1,-F);Position=UDim2.new(0,y,0,0),ScrollBarImageColor3=Z.Text1;VerticalScrollBarInset=Enum.ScrollBarInset.ScrollBar;ScrollingDirection=Enum.ScrollingDirection.Y}},{Text=V(X,{Size=UDim2.new(1,0,0,0),LayoutOrder=1,TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Top,FitAxis="\089",Font=Z.ButtonFont;TextSize=18,Text=J;TextWrap=true;TextColor3=Z.Text1,BackgroundTransparency=1})}),DismissButton=V(K,{layoutOrder=2,text="\068\105\115\109\105\115\115";secondary=true,onClick=function()v()end})})end)end return J
local Roact = require(script:FindFirstAncestor('MazeGeneratorPlugin').Roact)

local Plugin = script:FindFirstAncestor('Plugin')

local Theme = require(Plugin.Components.Theme)
local Panel = require(Plugin.Components.Panel)
local FitText = require(Plugin.Components.FitText)
local FitScrollingFrame = require(Plugin.Components.FitScrollingFrame)
local FormButton = require(Plugin.Components.FormButton)

local e = Roact.createElement

local BUTTON_HEIGHT = 60
local HOR_PADDING = 8

local ErrorPanel = Roact.Component:extend('ErrorPanel')

function ErrorPanel:render()
	local errorMessage = self.props.errorMessage
	local onDismiss = self.props.onDismiss

	return Theme.with(function(theme)
		return e(Panel, nil, {
			Layout = Roact.createElement('UIListLayout', {
				HorizontalAlignment = Enum.HorizontalAlignment.Center,
				VerticalAlignment = Enum.VerticalAlignment.Center,
				SortOrder = Enum.SortOrder.LayoutOrder,
				Padding = UDim.new(0, 8),
			}),
			ErrorContainer = e(
				FitScrollingFrame,
				{
					containerProps = {
						BackgroundTransparency = 1,
						BorderSizePixel = 0,
						Size = UDim2.new(1, -HOR_PADDING * 2, 1, -BUTTON_HEIGHT),
						Position = UDim2.new(0, HOR_PADDING, 0, 0),
						ScrollBarImageColor3 = theme.Text1,
						VerticalScrollBarInset = Enum.ScrollBarInset.ScrollBar,
						ScrollingDirection = Enum.ScrollingDirection.Y,
					},
				},
				{ Text = e(FitText, {
					Size = UDim2.new(1, 0, 0, 0),
					LayoutOrder = 1,
					TextXAlignment = Enum.TextXAlignment.Left,
					TextYAlignment = Enum.TextYAlignment.Top,
					FitAxis = 'Y',
					Font = theme.ButtonFont,
					TextSize = 18,
					Text = errorMessage,
					TextWrap = true,
					TextColor3 = theme.Text1,
					BackgroundTransparency = 1,
				}) }
			),
			DismissButton = e(FormButton, {
				layoutOrder = 2,
				text = 'Dismiss',
				secondary = true,
				onClick = function()
					onDismiss()
				end,
			}),
		})
	end)
end

return ErrorPanel