Files
test-alebro/Components/Layout/MovieTable.razor
Berack96 1b2ec9a1eb Favorites (#4)
* Added favorites page
* Refactor table to a reusable component

Reviewed-on: #4
Co-authored-by: Berack96 <giacomobertolazzi7@gmail.com>
Co-committed-by: Berack96 <giacomobertolazzi7@gmail.com>
2026-01-20 15:24:26 +01:00

35 lines
887 B
Plaintext

<table class="table table-striped" id="moviesTable">
<thead class="table-primary">
<tr>
<th></th>
<th style="width: 100%;">Title</th>
<th>Year</th>
</tr>
</thead>
<tbody>
@if (Movies?.Search != null)
{
@foreach (var movie in Movies.Search)
{
<tr>
<td><button class="btn btn-secondary" @onclick="() => OnMovieSelected(movie.IdIMDB)">Details</button></td>
<td>@movie.Title</td>
<td>@movie.Year</td>
</tr>
}
}
</tbody>
</table>
@inject NavigationManager NavigationManager
@code {
[Parameter]
public MovieSearch? Movies { get; set; }
private async Task OnMovieSelected(string imdbID)
{
NavigationManager.NavigateTo($"/movie/{imdbID}");
}
}