<script>
    SLM.module = './?a=home.main';

    /**
     * Load dashboard statistics
     */
    async function loadStats() {
        try {
            const result = await SLM.ajax('getStats');

            document.getElementById('stat-users').textContent = result.users || 0;
            document.getElementById('stat-active').textContent = result.active || 0;
            document.getElementById('stat-items').textContent = result.items || 0;
            document.getElementById('stat-activity').textContent = result.activity || 0;
        } catch (error) {
            console.error('Error loading stats:', error);
        }
    }

    document.addEventListener('DOMContentLoaded', loadStats);
</script>
