class CustomFileCard extends HTMLElement { static get observedAttributes() { return ['status']; } constructor() { super(); this.attachShadow({ mode: 'open' }); } connectedCallback() { this.render(); } attributeChangedCallback(name, oldValue, newValue) { if (name === 'status') { this.render(); } } render() { const name = this.getAttribute('name') || 'Untitled'; const status = this.getAttribute('status') || 'pending'; let statusText, statusColor, icon; switch(status) { case 'pending': statusText = 'Analyzing...'; statusColor = 'bg-yellow-500'; icon = 'clock'; break; case 'safe': statusText = 'Secure'; statusColor = 'bg-green-500'; icon = 'check-circle'; break; case 'vulnerable': statusText = 'Vulnerable'; statusColor = 'bg-red-500'; icon = 'alert-triangle'; break; case 'error': statusText = 'Error'; statusColor = 'bg-gray-500'; icon = 'x-circle'; break; default: statusText = 'Unknown'; statusColor = 'bg-gray-500'; icon = 'help-circle'; } this.shadowRoot.innerHTML = `

${name}

${statusText}
`; // Replace feather icons if (this.shadowRoot.querySelector('[data-feather]')) { feather.replace(); } } } customElements.define('custom-file-card', CustomFileCard);