ilteredDatasets.slice(startIndex, endIndex);

                datasetContainer.innerHTML = '';

                if (currentPageItems.length === 0) {
                    datasetContainer.innerHTML = '<p class="col-span-full text-center">No datasets found matching your search.</p>';
                    return;
                }

                if (currentView === 'grid') {
                    datasetContainer.className = 'grid-view';
                    displayGridView(currentPageItems);
                } el