class CustomSearchBar extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = `
`; // Add event listener after rendering setTimeout(() => { const searchInput = this.shadowRoot.getElementById('searchInput'); searchInput.addEventListener('input', (e) => { // Access the global search function if (typeof searchPrompts === 'function') { searchPrompts(e.target.value); } }); // Initialize feather icons feather.replace(); }, 0); } } customElements.define('custom-search-bar', CustomSearchBar);