local T=script.Parent.Parent.Parent local O=require(T.Constants)local a=require(T.Packages.Roact)local D=require(T.Packages.StudioComponents)local w=D.withTheme local v=O.ListEntryHeight local H=a.Component:extend("\076\105\115\116\069\110\116\114\121")function H.init(T)T:setState({Hover=false})T.onInputBegan=function(O,a)if T.props.Disabled then return end if a.UserInputType==Enum.UserInputType.MouseMovement then T:setState({Hover=true})end end T.onInputEnded=function(O,a)if a.UserInputType==Enum.UserInputType.MouseMovement then T:setState({Hover=false})end end end function H.render(T)local O=Enum.StudioStyleGuideColor.FilterButtonDefault if T.props.Selected then O=Enum.StudioStyleGuideColor.FilterButtonChecked elseif T.state.Hover then O=Enum.StudioStyleGuideColor.FilterButtonHover end return w(function(D)return a.createElement("\084\101\120\116\066\117\116\116\111\110",{LayoutOrder=T.props.Order;AutoButtonColor=false;BorderSizePixel=0;BackgroundColor3=D:GetColor(O);Font=Enum.Font.SourceSans,Text=T.props.Group.name;TextSize=14;TextColor3=D:GetColor(Enum.StudioStyleGuideColor.MainText),Size=UDim2.new(1,0,0,v),TextXAlignment=Enum.TextXAlignment.Left,TextTruncate=Enum.TextTruncate.AtEnd;[a.Event.InputBegan]=T.onInputBegan,[a.Event.InputEnded]=T.onInputEnded,[a.Event.Activated]=function()if not T.props.Disabled then T.props.OnActivated()end end},{Padding=a.createElement("\085\073\080\097\100\100\105\110\103",{PaddingLeft=UDim.new(0,7),PaddingRight=UDim.new(0,5)})})end)end return H
local Plugin = script.Parent.Parent.Parent
local Constants = require(Plugin.Constants)

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

local withTheme = StudioComponents.withTheme

local ENTRY_HEIGHT = Constants.ListEntryHeight

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

function ListEntry:init()
	self:setState({ Hover = false })
	self.onInputBegan = function(_, input)
		if self.props.Disabled then
			return
		end
		if input.UserInputType == Enum.UserInputType.MouseMovement then
			self:setState({ Hover = true })
		end
	end
	self.onInputEnded = function(_, input)
		if input.UserInputType == Enum.UserInputType.MouseMovement then
			self:setState({ Hover = false })
		end
	end
end

function ListEntry:render()
	local color = Enum.StudioStyleGuideColor.FilterButtonDefault
	if self.props.Selected then
		color = Enum.StudioStyleGuideColor.FilterButtonChecked
	elseif self.state.Hover then
		color = Enum.StudioStyleGuideColor.FilterButtonHover
	end
	return withTheme(function(theme)
		return Roact.createElement("TextButton", {
			LayoutOrder = self.props.Order,
			AutoButtonColor = false,
			BorderSizePixel = 0,
			BackgroundColor3 = theme:GetColor(color),
			Font = Enum.Font.SourceSans,
			Text = self.props.Group.name,
			TextSize = 14,
			TextColor3 = theme:GetColor(Enum.StudioStyleGuideColor.MainText),
			Size = UDim2.new(1, 0, 0, ENTRY_HEIGHT),
			TextXAlignment = Enum.TextXAlignment.Left,
			TextTruncate = Enum.TextTruncate.AtEnd,
			[Roact.Event.InputBegan] = self.onInputBegan,
			[Roact.Event.InputEnded] = self.onInputEnded,
			[Roact.Event.Activated] = function()
				if not self.props.Disabled then
					self.props.OnActivated()
				end
			end,
		}, {
			Padding = Roact.createElement("UIPadding", {
				PaddingLeft = UDim.new(0, 7),
				PaddingRight = UDim.new(0, 5),
			}),
		})
	end)
end

return ListEntry
