All files / app/features/history/pages/pictures-history pictures-history.component.ts

100% Statements 13/13
100% Branches 0/0
100% Functions 3/3
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 391x 1x 1x 1x 1x                                         1x 11x 11x 11x     11x       1x      
import { PicturePendingCardComponent } from '../../components/picture-pending-card/picture-pending-card.component';
import { PicturesHistoryService, trackByFn } from '../../services/pictures-history.service';
import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import {
    FormatTimePipe,
    SpinnerComponent,
    VirtualScrollerComponent,
    VirtualScrollerItemDirective,
} from '@drevo-web/ui';
 
@Component({
    selector: 'app-pictures-history',
    imports: [
        PicturePendingCardComponent,
        SpinnerComponent,
        VirtualScrollerComponent,
        VirtualScrollerItemDirective,
        FormatTimePipe,
    ],
    templateUrl: './pictures-history.component.html',
    styleUrl: './pictures-history.component.scss',
    changeDetection: ChangeDetectionStrategy.OnPush,
    providers: [PicturesHistoryService],
})
export class PicturesHistoryComponent implements OnInit {
    protected readonly service = inject(PicturesHistoryService);
    protected readonly trackByFn = trackByFn;
    private readonly router = inject(Router);
 
    ngOnInit(): void {
        this.service.init();
    }
 
    onPictureClick(pictureId: number): void {
        this.router.navigate(['/pictures', pictureId]);
    }
}