28 lines
1.2 KiB
TypeScript
28 lines
1.2 KiB
TypeScript
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
import { MatButton } from '@angular/material/button';
|
|
import { MatProgressBar } from '@angular/material/progress-bar';
|
|
import { RouterLink } from '@angular/router';
|
|
import { Store } from '@ngrx/store';
|
|
|
|
import { CityCatalogService } from '../../root/services/city-catalog.service';
|
|
import { Icon } from '../../shared/icon/icon';
|
|
import { selectCollectedIdSet, selectOpenedCount, selectProgress } from '../../state';
|
|
|
|
@Component({
|
|
selector: 'app-cities-page',
|
|
imports: [RouterLink, MatButton, MatProgressBar, Icon],
|
|
templateUrl: './cities-page.html',
|
|
styleUrl: './cities-page.scss',
|
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
})
|
|
export class CitiesPage {
|
|
private readonly catalog = inject(CityCatalogService);
|
|
private readonly store = inject(Store);
|
|
|
|
protected readonly city = this.catalog.city;
|
|
protected readonly collectedIds = this.store.selectSignal(selectCollectedIdSet);
|
|
protected readonly openedCount = this.store.selectSignal(selectOpenedCount);
|
|
protected readonly totalCount = this.city.objects.length;
|
|
protected readonly progress = this.store.selectSignal(selectProgress);
|
|
}
|