diff --git a/frontend/public/off.html b/frontend/public/off.html index 23970e95..3c697db8 100644 --- a/frontend/public/off.html +++ b/frontend/public/off.html @@ -177,13 +177,10 @@
-
- - search - 565 products, found in 1804 ms - -
+
+ +
`; + + /** + * Render the component + */ + override render() { + if (this.nbResults > 0) { + return this.nbResults + ' results found'; + } else if (this.searchLaunched) { + return html`${this.noResults}`; + } else { + return html`${this.beforeSearch}`; + } + } + + /** + * Handle the search result event + */ + override handleResults(event: SearchResultEvent) { + this.nbResults = event.detail.count; // it's reactive so it will trigger a render + } +} + +declare global { + interface HTMLElementTagNameMap { + 'searchalicious-count': SearchCount; + } +}