import { Component, ChangeDetectionStrategy, signal } from '@angular/core'; import { take } from 'rxjs/operators'; import { RouterLink } from '@angular/router'; import { TranslatePipe } from '../../i18n/translate.pipe'; import { LogoComponent } from '../logo/logo.component'; import { UiRuntimeFacade } from '../../facades/runtime/ui-runtime.facade'; import { LangRoutePipe } from '../../pipes/lang-route.pipe'; import { FooterPaymentIcon, FooterResolvedGroup, FooterResolverService } from '../../core/config/footer-resolver.service'; @Component({ selector: 'app-footer', imports: [TranslatePipe, LogoComponent, RouterLink, LangRoutePipe], templateUrl: './footer.component.html', styleUrls: ['./footer.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush }) export class FooterComponent { readonly footerGroups = signal([]); readonly paymentIcons = signal([]); readonly copyrightText = signal(''); constructor( private readonly uiRuntime: UiRuntimeFacade, private readonly footerResolver: FooterResolverService ) { this.footerResolver.resolveFooterModel().pipe(take(1)).subscribe({ next: model => { this.footerGroups.set(model.groups); this.paymentIcons.set(model.paymentIcons); this.copyrightText.set(model.copyrightText); }, error: () => { this.footerGroups.set([]); this.paymentIcons.set([]); this.copyrightText.set(''); } }); } currentYear = new Date().getFullYear(); get brandName(): string { return this.uiRuntime.marketplaceName(); } get contactEmail(): string { return this.uiRuntime.contactEmail(); } }