All files / app/shared/components/error error.component.ts

100% Statements 11/11
75% Branches 6/8
100% Functions 3/3
100% Lines 10/10

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 235x 5x                 5x 5x 5x   18x 6x   18x 7x   18x    
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import { ButtonComponent, IconComponent } from '@drevo-web/ui';
 
@Component({
    selector: 'app-error',
    imports: [ButtonComponent, IconComponent],
    templateUrl: './error.component.html',
    styleUrl: './error.component.scss',
    changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ErrorComponent {
    private static readonly DEFAULT_TITLE = 'Страница не найдена';
    private static readonly DEFAULT_MESSAGE = 'Запрашиваемая страница не существует или была удалена.';
 
    readonly title = input(ErrorComponent.DEFAULT_TITLE, {
        transform: (value: string | undefined) => value ?? ErrorComponent.DEFAULT_TITLE,
    });
    readonly message = input(ErrorComponent.DEFAULT_MESSAGE, {
        transform: (value: string | undefined) => value ?? ErrorComponent.DEFAULT_MESSAGE,
    });
    readonly showHomeButton = input(false);
}