return function(s)local Q=s.create return s.widget(function(a,i)i=i or{}local q,U=s.useState(false)local z=s.useStyle()local u=s.useInstance(function(q)local u=z.textColor local N=(u.R*255)*.8 local b=Color3.fromRGB(N,N,N)local Y=Q("\084\101\120\116\066\117\116\116\111\110",{[q]="\098\117\116\116\111\110",BackgroundTransparency=1;Text="";Q("\085\073\080\097\100\100\105\110\103",{PaddingBottom=UDim.new(0,0),PaddingLeft=UDim.new(0,8);PaddingRight=UDim.new(0,8);PaddingTop=UDim.new(0,0)}),Q("\085\073\076\105\115\116\076\097\121\111\117\116",{SortOrder=Enum.SortOrder.LayoutOrder,FillDirection=Enum.FillDirection.Horizontal}),Q("\084\101\120\116\076\097\098\101\108",{Name="\073\099\111\110";BackgroundTransparency=1,Size=UDim2.new(0,30,1,0);Text=i.icon;TextXAlignment=Enum.TextXAlignment.Left,TextSize=16;TextColor3=z.textColor;Font=Enum.Font.GothamBold}),Q("\084\101\120\116\076\097\098\101\108",{[q]="\109\097\105\110\084\101\120\116";Name="\077\097\105\110\084\101\120\116";BackgroundTransparency=1,Size=UDim2.new(0,0,1,0);Text=a;TextXAlignment=Enum.TextXAlignment.Left;TextColor3=b,TextSize=14}),Activated=function()if i.disabled then return end U(true)end;MouseEnter=function()if i.disabled then return end q.button.MainText.TextColor3=u end;MouseLeave=function()q.button.MainText.TextColor3=b end})s.automaticSize(Y)s.automaticSize(q.mainText,{axis=Enum.AutomaticSize.X})return Y end)u.button.MainText.Text=a u.button.Icon.Text=i.icon or""u.button.Icon.Visible=not(not i.icon)u.mainText.Font=i.font or Enum.Font.Gotham return{clicked=function()if q then U(false)return true end return false end}end)end
return function(Plasma)
	local create = Plasma.create

	return Plasma.widget(function(text, options)
		options = options or {}

		local clicked, setClicked = Plasma.useState(false)
		local style = Plasma.useStyle()

		local refs = Plasma.useInstance(function(ref)
			local colorHover = style.textColor

			local darker = colorHover.R * 255 * 0.8 -- 20% darker
			local color = Color3.fromRGB(darker, darker, darker)

			local button = create("TextButton", {
				[ref] = "button",
				BackgroundTransparency = 1,
				Text = "",

				create("UIPadding", {
					PaddingBottom = UDim.new(0, 0),
					PaddingLeft = UDim.new(0, 8),
					PaddingRight = UDim.new(0, 8),
					PaddingTop = UDim.new(0, 0),
				}),

				create("UIListLayout", {
					SortOrder = Enum.SortOrder.LayoutOrder,
					FillDirection = Enum.FillDirection.Horizontal,
				}),

				create("TextLabel", {
					Name = "Icon",
					BackgroundTransparency = 1,
					Size = UDim2.new(0, 30, 1, 0),
					Text = options.icon,
					TextXAlignment = Enum.TextXAlignment.Left,
					TextSize = 16,
					TextColor3 = style.textColor,
					Font = Enum.Font.GothamBold,
				}),

				create("TextLabel", {
					[ref] = "mainText",
					Name = "MainText",
					BackgroundTransparency = 1,
					Size = UDim2.new(0, 0, 1, 0),
					Text = text,
					TextXAlignment = Enum.TextXAlignment.Left,
					TextColor3 = color,
					TextSize = 14,
				}),

				Activated = function()
					if options.disabled then
						return
					end

					setClicked(true)
				end,

				MouseEnter = function()
					if options.disabled then
						return
					end

					ref.button.MainText.TextColor3 = colorHover
				end,

				MouseLeave = function()
					ref.button.MainText.TextColor3 = color
				end,
			})

			Plasma.automaticSize(button)
			Plasma.automaticSize(ref.mainText, {
				axis = Enum.AutomaticSize.X,
			})

			return button
		end)

		refs.button.MainText.Text = text

		refs.button.Icon.Text = options.icon or ""
		refs.button.Icon.Visible = not not options.icon

		refs.mainText.Font = options.font or Enum.Font.Gotham

		return {
			clicked = function()
				if clicked then
					setClicked(false)
					return true
				end

				return false
			end,
		}
	end)
end
