--- Cleans up tracking resources.

function ScopeHUD:willUnmount()
    self.Maid:Destroy()
end

function ScopeHUD:render()
    return new('Frame', {
        Active = true;
        Draggable = true;
        Position = self.state.IsToolModeEnabled and
            UDim2.new(0, 10/2, 1, -8/2) or
            UDim2.new(0, 10/2, 0, 8/2);
        AnchorPoint = self.state.IsToolModeEnabled and
            Vector2.new(0, 1) or
            Vector2.new(0, 0);
        Size = self.ContainerSize;
        BackgroundTransparency = 1;
        [Roact.Event.InputBegan] = self.OnInputBegin;
        [Roact.Event.InputEnded] = self.OnInputEnd;
    },
    Support.Merge(self:BuildScopeHierarchyButtons(), {
        Layout = new('UIListLayout', {
            [Roact.Ref] = self.LayoutRef;
            FillDirection = Enum.FillDirection.Horizontal;
            HorizontalAlignment = Enum.HorizontalAlignment.Left;
            VerticalAlignment = Enum.VerticalAlignment.Center;
            SortOrder = Enum.SortOrder.LayoutOrder;
            Padding = UDim.new(0, 5/2);
        });
        ModeToggle = new(ModeToggle, {
            Core = self.props.Core;
            IsToolModeEnabled = self.state.IsToolModeEnabled;
        });
    }))
end
