               filteredDatasets.sort((a, b) => a.title.localeCompare(b.title));
                        break;
                    case 'title-desc':
                        filteredDatasets.sort((a, b) => b.title.localeCompare(a.title));
                        break;
                    case 'group':
                        filteredDatasets.sort((a, b) => {
                            const groupA = a.thematic_group || '';
                            const groupB = b.thematic_group || '';
                