class OrderCard extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open' }); } connectedCallback() { const status = this.getAttribute('status') || 'new'; const statusColors = { new: 'bg-blue-100 text-blue-800', pending: 'bg-yellow-100 text-yellow-800', progress: 'bg-purple-100 text-purple-800', delivered: 'bg-green-100 text-green-800', paid: 'bg-indigo-100 text-indigo-800' }; this.shadowRoot.innerHTML = `
Order #${this.getAttribute('id')}
${status.toUpperCase()}
Customer: ${this.getAttribute('customer')}
Items: ${this.getAttribute('items')}
Total: ₹${this.getAttribute('total')}
`; } } customElements.define('order-card', OrderCard);