import { initAdminClubs } from './clubsSection.js';
import { initAdminEvents } from './eventsSection.js';
import { initApplicationsSection } from './applicationsSection.js';
import { initSiteImages } from './siteImagesSection.js';
import { initAdminGallery } from './gallerySection.js';

function onStats(stats) {
    if (stats.clubs  != null) $('#stat-clubs').text(stats.clubs);
    if (stats.courts != null) $('#stat-courts').text(stats.courts);
    if (stats.events != null) $('#stat-events').text(stats.events);
    if (stats.active != null) $('#stat-active').text(stats.active);
}

initAdminClubs($('#admin-clubs-container'), onStats);
initAdminEvents($('#admin-events-container'), onStats);
initApplicationsSection($('#admin-applications-container'));
initSiteImages();
initAdminGallery($('#admin-gallery-container'));
