Spaces:
Running
Running
| // Main script file for the admin dashboard | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize feather icons | |
| if (typeof feather !== 'undefined') { | |
| feather.replace(); | |
| } | |
| // Update header user name if custom-header is present | |
| const customHeader = document.querySelector('custom-header'); | |
| if (customHeader && customHeader.shadowRoot) { | |
| const userNameEl = customHeader.shadowRoot.querySelector('.user-name'); | |
| if (userNameEl) { | |
| // Try to get from localStorage, otherwise default | |
| const storedName = localStorage.getItem('userName'); | |
| if (storedName) { | |
| userNameEl.textContent = storedName; | |
| } | |
| } | |
| } | |
| }); | |