class StatusBadge extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
connectedCallback() {
const status = this.getAttribute('status') || '';
const icon = this.getAttribute('icon') || '';
this.shadowRoot.innerHTML = `
${icon ? `` : ''}
${this.getStatusText(status)}
`;
}
getStatusText(status) {
switch(status) {
case 'approved': return 'Approved';
case 'pending': return 'Pending';
case 'rejected': return 'Rejected';
default: return status;
}
}
}
customElements.define('status-badge', StatusBadge);