mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-12 12:06:16 -08:00
72 lines
2.4 KiB
HTML
72 lines
2.4 KiB
HTML
<div class="recent-container">
|
|
<div class="header">
|
|
<h2>Recently Viewed</h2>
|
|
<div class="header-actions">
|
|
@if (recentItems()?.length) {
|
|
<button mat-button color="warn" (click)="clearHistory()">
|
|
<mat-icon>delete</mat-icon>
|
|
Clear History
|
|
</button>
|
|
} @if (isGlobal) {
|
|
<button mat-icon-button (click)="dialogRef.close()">
|
|
<mat-icon>close</mat-icon>
|
|
</button>
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
@if (recentItems()?.length) { @if (isGlobal) {
|
|
<div class="playlist-section">
|
|
<h2 class="section-title">
|
|
Found {{ recentItems().length }} items across
|
|
{{ (getGroupedItems() | keyvalue).length }} playlists
|
|
</h2>
|
|
@for (group of getGroupedItems() | keyvalue; track group.key) {
|
|
<div class="playlist-group">
|
|
<h3 class="playlist-title">
|
|
<mat-icon>playlist_play</mat-icon>
|
|
{{ group.key }}
|
|
<span class="item-count"
|
|
>({{ $any(group).value.length }} items)</span
|
|
>
|
|
</h3>
|
|
<div class="items-grid">
|
|
@for (item of $any(group).value; track item.id) {
|
|
<app-content-card
|
|
[posterUrl]="item.poster_url"
|
|
[title]="item.title"
|
|
[type]="item.type"
|
|
[date]="item.viewed_at"
|
|
[showRemoveButton]="true"
|
|
[removeTooltip]="'Remove from history'"
|
|
(cardClick)="openItem(item)"
|
|
(remove)="onRemoveItem(item.id)"
|
|
/>
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
} @else {
|
|
<div class="items-grid">
|
|
@for (item of recentItems(); track item.id) {
|
|
<app-content-card
|
|
[posterUrl]="item.poster_url"
|
|
[title]="item.title"
|
|
[type]="item.type"
|
|
[date]="item.viewed_at"
|
|
[showRemoveButton]="true"
|
|
[removeTooltip]="'Remove from history'"
|
|
(cardClick)="openItem(item)"
|
|
(remove)="onRemoveItem(item.id)"
|
|
/>
|
|
}
|
|
</div>
|
|
} } @else {
|
|
<div class="no-items">
|
|
<mat-icon>history</mat-icon>
|
|
<p>No recently viewed items</p>
|
|
</div>
|
|
}
|
|
</div>
|