local o=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local T=o:WaitForChild("\099\111\109\109\111\110")local m=o:WaitForChild("\108\105\098")local M=require(T:WaitForChild("\083\101\108\101\099\116\111\114\115"))local N=require(m:WaitForChild("\082\111\097\099\116"))local y=require(m:WaitForChild("\082\111\097\099\116\082\111\100\117\120"))local k=N.Component:extend("\077\101\110\117\066\117\116\116\111\110")function k.init(o)o:setState(function(o)return{hovered=false}end)end function k.setHovered(T,o)T:setState(function(T)return{hovered=o}end)end function k.render(o)return N.createElement("\073\109\097\103\101\066\117\116\116\111\110",{Size=UDim2.new(0,80,0,80),BorderSizePixel=0,BackgroundColor3=Color3.fromRGB(255,255,255);BackgroundTransparency=1,ImageTransparency=0,Image="\114\098\120\097\115\115\101\116\105\100\058\047\047\052\049\048\051\049\052\057\054\057\048";ScaleType=Enum.ScaleType.Slice;SliceCenter=Rect.new(16,16,16,16);LayoutOrder=o.props.layoutOrder or 0,[N.Event.MouseButton1Click]=function()o.props.callback(o.props.viewId,o.props.parentProps)end;[N.Event.MouseEnter]=function()o:setHovered(true)end;[N.Event.MouseLeave]=function()o:setHovered(false)end},{icon=N.createElement("\073\109\097\103\101\076\097\098\101\108",{AnchorPoint=Vector2.new(.5,.5);Position=UDim2.new(.5,0,.5,0);Size=UDim2.new(0,64,0,64);BackgroundTransparency=1,Image=o.props.image or"\114\098\120\097\115\115\101\116\105\100\058\047\047\052\049\048\050\057\055\054\057\053\054",ImageColor3=Color3.new(0,0,0)});label=(o.state.hovered or o.props.viewActive)and N.createElement("\073\109\097\103\101\076\097\098\101\108",{AnchorPoint=Vector2.new(.5,0),Position=UDim2.new(.5,0,1,8),Size=UDim2.new(0,128,0,32),BorderSizePixel=0,BackgroundColor3=Color3.fromRGB(255,255,255),BackgroundTransparency=1,ImageTransparency=0;Image="\114\098\120\097\115\115\101\116\105\100\058\047\047\052\049\048\051\049\052\057\054\057\048",ScaleType=Enum.ScaleType.Slice,SliceCenter=Rect.new(16,16,16,16)},{text=N.createElement("\084\101\120\116\076\097\098\101\108",{Size=UDim2.new(1,0,1,0),BackgroundTransparency=1;Text=o.props.name,Font=Enum.Font.GothamBlack;TextSize=16})})})end local function f(o,T)return{viewActive=M.getUIView(o)==T.viewId}end k=(y.connect(f,nil))(k)return k
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local common = ReplicatedStorage:WaitForChild("common")
local lib = ReplicatedStorage:WaitForChild("lib")

local Selectors = require(common:WaitForChild("Selectors"))
local Roact = require(lib:WaitForChild("Roact"))
local RoactRodux = require(lib:WaitForChild("RoactRodux"))

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

function MenuButton:init()
    self:setState(function(state)
        return {
            hovered = false
        }
    end)
end

function MenuButton:setHovered(bool)
    self:setState(function(state)
        return {
            hovered = bool
        }
    end)
end

function MenuButton:render()
    return Roact.createElement("ImageButton", {
        Size = UDim2.new(0,80,0,80),
        BorderSizePixel = 0,
        BackgroundColor3 = Color3.fromRGB(255,255,255),
        BackgroundTransparency = 1,
        ImageTransparency = 0,
        Image = "rbxassetid://4103149690",
        ScaleType = Enum.ScaleType.Slice,
        SliceCenter = Rect.new(16, 16, 16, 16),
        LayoutOrder = self.props.layoutOrder or 0,
        [Roact.Event.MouseButton1Click] = function() self.props.callback(self.props.viewId,self.props.parentProps) end,
        [Roact.Event.MouseEnter] = function()
            self:setHovered(true)
        end,
        [Roact.Event.MouseLeave] = function()
            self:setHovered(false)
        end,
    }, {
        icon = Roact.createElement("ImageLabel", {
            AnchorPoint = Vector2.new(0.5,0.5),
            Position = UDim2.new(0.5,0,0.5,0),
            Size = UDim2.new(0,64,0,64),
            BackgroundTransparency = 1,
            Image = self.props.image or "rbxassetid://4102976956",
            ImageColor3 = Color3.new(0,0,0),
        }),
        label = (self.state.hovered or self.props.viewActive) and Roact.createElement("ImageLabel", {
            AnchorPoint = Vector2.new(0.5,0),
            Position = UDim2.new(0.5,0,1,8),
            Size = UDim2.new(0,128,0,32),
            BorderSizePixel = 0,
            BackgroundColor3 = Color3.fromRGB(255,255,255),
            BackgroundTransparency = 1,
            ImageTransparency = 0,
            Image = "rbxassetid://4103149690",
            ScaleType = Enum.ScaleType.Slice,
            SliceCenter = Rect.new(16, 16, 16, 16),
        }, {
            text = Roact.createElement("TextLabel", {
                Size = UDim2.new(1,0,1,0),
                BackgroundTransparency = 1,
                Text = self.props.name,
                Font = Enum.Font.GothamBlack,
                TextSize = 16
            })
        })
    })
end

local function mapStateToProps(state,props)
    return {
        viewActive = Selectors.getUIView(state) == props.viewId
    }
end

MenuButton = RoactRodux.connect(mapStateToProps,nil)(MenuButton)

return MenuButton