2024-04-26 23:38:36 +02:00
|
|
|
import { Component } from "@angular/core";
|
2024-04-17 22:06:33 +02:00
|
|
|
import { map, Observable } from "rxjs";
|
|
|
|
|
|
|
|
import { ProductSwitcherItem, ProductSwitcherService } from "../shared/product-switcher.service";
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: "navigation-product-switcher",
|
|
|
|
templateUrl: "./navigation-switcher.component.html",
|
|
|
|
})
|
|
|
|
export class NavigationProductSwitcherComponent {
|
|
|
|
constructor(private productSwitcherService: ProductSwitcherService) {}
|
|
|
|
|
2024-04-26 23:34:15 +02:00
|
|
|
protected readonly accessibleProducts$: Observable<ProductSwitcherItem[]> =
|
2024-04-17 22:06:33 +02:00
|
|
|
this.productSwitcherService.products$.pipe(
|
|
|
|
map((products) => (products.bento ?? []).filter((item) => !item.isActive)),
|
|
|
|
);
|
|
|
|
|
2024-04-26 23:34:15 +02:00
|
|
|
protected readonly moreProducts$: Observable<ProductSwitcherItem[]> =
|
|
|
|
this.productSwitcherService.products$.pipe(
|
|
|
|
map((products) => (products.other ?? []).filter((item) => !item.isActive)),
|
|
|
|
);
|
2024-04-17 22:06:33 +02:00
|
|
|
}
|