local f=Cheer.CreateComponent("\084\111\111\108\116\105\112",View)local F={}function f.Start(R)View.Visible=false View.Text=R F.ShowOnEnter=Support.AddGuiInputListener(View.Parent,"\066\101\103\097\110","\077\111\117\115\101\077\111\118\101\109\101\110\116",true,f.Show)F.HideOnLeave=Support.AddGuiInputListener(View.Parent,"\069\110\100\101\100","\077\111\117\115\101\077\111\118\101\109\101\110\116",true,f.Hide)Cheer.Bind(f.OnRemove,ClearConnections)return f end function f.Show()View.Size=UDim2.new(0,View.TextBounds.X+10,0,View.TextBounds.Y+10)View.Position=UDim2.new(.5,-View.AbsoluteSize.X/2,1,3)View.Visible=true end function f.Hide()View.Visible=false end function ClearConnections()for f,R in pairs(F)do R:disconnect()F[f]=nil end end return f
-- Create component
local Component = Cheer.CreateComponent("Tooltip", View)

local Connections = {}

function Component.Start(Text)
	-- Hide the view
	View.Visible = false

	-- Set the tooltip text
	View.Text = Text

	-- Show the tooltip on hover
	Connections.ShowOnEnter = Support.AddGuiInputListener(View.Parent, "Began", "MouseMovement", true, Component.Show)
	Connections.HideOnLeave = Support.AddGuiInputListener(View.Parent, "Ended", "MouseMovement", true, Component.Hide)

	-- Clear connections when the component is removed
	Cheer.Bind(Component.OnRemove, ClearConnections)

	-- Return component for chaining
	return Component
end

function Component.Show()
	View.Size = UDim2.new(0, View.TextBounds.X + 10, 0, View.TextBounds.Y + 10)
	View.Position = UDim2.new(0.5, -View.AbsoluteSize.X / 2, 1, 3)
	View.Visible = true
end

function Component.Hide()
	View.Visible = false
end

function ClearConnections()
	-- Clears out temporary connections

	for ConnectionKey, Connection in pairs(Connections) do
		Connection:disconnect()
		Connections[ConnectionKey] = nil
	end
end

return Component
