Dashboard component uses app-book-card

This commit is contained in:
aditya.chandel
2024-12-22 12:03:48 -07:00
parent 4704d9f5f0
commit 47ec1c3930
2 changed files with 4 additions and 8 deletions
@@ -13,13 +13,7 @@
#scrollContainer #scrollContainer
[horizontal]="true"> [horizontal]="true">
<div class="book-item" *ngFor="let book of booksSignal!()"> <div class="book-item" *ngFor="let book of booksSignal!()">
<img [src]="coverImageSrc(book.id)" class="book-cover" alt="Cover of {{ book.metadata?.title }}" loading="lazy"/> <app-book-card [book]="book"></app-book-card>
<div class="book-info">
<h4>{{ book.metadata?.title }}</h4>
<p>{{ getAuthorNames(book) }}</p>
<p-button [rounded]="true" icon="pi pi-eye" class="view-btn" (click)="openBook(book)"></p-button>
<p-button [rounded]="true" icon="pi pi-info" class="read-btn" (click)="openBookInfo(book.id, book.libraryId)"></p-button>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -5,6 +5,7 @@ import {Button} from 'primeng/button';
import {InfiniteScrollDirective} from 'ngx-infinite-scroll'; import {InfiniteScrollDirective} from 'ngx-infinite-scroll';
import {NgForOf, NgIf} from '@angular/common'; import {NgForOf, NgIf} from '@angular/common';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import {BookCardComponent} from '../book-card/book-card.component';
@Component({ @Component({
selector: 'app-dashboard-scroller', selector: 'app-dashboard-scroller',
@@ -14,7 +15,8 @@ import {Router} from '@angular/router';
Button, Button,
InfiniteScrollDirective, InfiniteScrollDirective,
NgForOf, NgForOf,
NgIf NgIf,
BookCardComponent
], ],
}) })
export class DashboardScrollerComponent implements OnInit { export class DashboardScrollerComponent implements OnInit {