import { Component, Prop, Watch, Event, EventEmitter, h } from '@stencil/core'; import { Product } from '../../classes/product'; @Component({ tag: 'order-summary', styleUrl: 'order-summary.css', scoped: true, }) export class OrderSummary { @Prop() products: Product[]; @Event() toggleSummary: EventEmitter; toggleStatusBarHandler() { this.toggleSummary.emit(); } @Watch('products') formatProducts() { const activeProducts = this.products.filter(x => x.quantity > 0); if (activeProducts.length == 0) { return