import { Component, Prop, Event, EventEmitter, h } from '@stencil/core'; import { formatCurrency, getConfig } from '../../classes/helpers'; @Component({ tag: 'status-bar', styleUrl: 'status-bar.css', scoped: true, }) export class StatusBar { @Prop() currentPrice: number; @Prop() summaryActive: boolean; @Event() toggleSummary: EventEmitter; toggleStatusBarHandler() { this.toggleSummary.emit(); } @Event() progressStepChanged: EventEmitter; progressStepChangedHandler() { this.progressStepChanged.emit(); } renderContinueButton() { const amountToSpend = getConfig().minTotal - this.currentPrice; if (amountToSpend > 0) { return ( ); } return ( ); } render() { const summaryClass = this.summaryActive ? 'summary-button active' : 'summary-button'; return (
Total:  {formatCurrency(this.currentPrice)}
Free delivery included with subscription
{this.renderContinueButton()}
); } }