import BaseComponent from './base-component.js'; export default class ErrorBoundary extends BaseComponent { constructor() { super(); this.error = null; this.errorInfo = null; } _getStyles() { return ``; } _getTemplate() { if (!this.error) { return ''; } return ` `; } catch(error, errorInfo) { this.error = error; this.errorInfo = errorInfo; this.render(); console.error('Error caught by boundary:', error, errorInfo); } reset() { this.error = null; this.errorInfo = null; this.render(); } } customElements.define('error-boundary', ErrorBoundary);