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 | 3x 3x 24x 24x 24x 24x 24x 24x 24x 4x 1x 3x 3x | import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';
import { Picture } from '@drevo-web/shared';
@Component({
selector: 'app-picture-card',
templateUrl: './picture-card.component.html',
styleUrl: './picture-card.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class PictureCardComponent {
readonly picture = input.required<Picture>();
readonly width = input.required<number>();
readonly height = input.required<number>();
readonly rowHeight = input.required<number>();
readonly isCapped = computed(() => this.height() < this.rowHeight());
readonly detailUrl = computed(() => `/pictures/${this.picture().id}`);
readonly pictureClick = output<Picture>();
onClick(event: MouseEvent): void {
if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) {
return;
}
event.preventDefault();
this.pictureClick.emit(this.picture());
}
}
|