// user-dashboard.js — extracted from user_dashboard.html
// Data injected via window.__DATA__

// Message expand/collapse
document.querySelectorAll('.expand-btn').forEach(function(btn) {
    btn.addEventListener('click', function() {
        var full = this.getAttribute('data-full');
        if (this.dataset.expanded === 'true') {
            this.parentElement.childNodes[0].textContent = full.substring(0, 60) + '... ';
            this.textContent = 'Expand';
            this.dataset.expanded = 'false';
        } else {
            this.parentElement.childNodes[0].textContent = full + ' ';
            this.textContent = 'Collapse';
            this.dataset.expanded = 'true';
        }
    });
});
