// Run the reset functionality to make it pretty/handle multiple instances etc.
            resetWidgetToAvailable($widget);
        }

        function addWidgetRemoveButton(item) {
            const $removeButton = $('<i/>')
                .addClass('fa-solid fa-trash pull-right delete-widget')
                .css('margin-right', '10px')
                .attr('title', 'Click to remove this widget.')
                .attr('data-toggle', 'tooltip')
                .click((evt) => {
                    evt