2024-06-01 22:47:56 -05:00
|
|
|
@using LANCommander.Client.Data.Models
|
|
|
|
|
@inject MediaService MediaService
|
|
|
|
|
|
2024-06-08 02:58:18 -05:00
|
|
|
@if (Media != null)
|
|
|
|
|
{
|
2024-06-10 23:28:58 -05:00
|
|
|
<img src="media://@(Media.FileId)-@(Media.Crc32)?mime=@(Media.MimeType)" class="@Class" />
|
2024-06-08 02:58:18 -05:00
|
|
|
}
|
2024-06-01 22:47:56 -05:00
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
[Parameter] public Guid Id { get; set; }
|
2024-06-02 17:39:32 -05:00
|
|
|
[Parameter] public string Class { get; set; }
|
2024-06-01 22:47:56 -05:00
|
|
|
|
|
|
|
|
Media Media { get; set; }
|
|
|
|
|
string Data { get; set; }
|
|
|
|
|
|
|
|
|
|
protected override async Task OnParametersSetAsync()
|
|
|
|
|
{
|
|
|
|
|
Media = await MediaService.Get(Id);
|
|
|
|
|
|
|
|
|
|
var path = MediaService.GetImagePath(Media);
|
|
|
|
|
|
|
|
|
|
if (File.Exists(path))
|
|
|
|
|
Data = Convert.ToBase64String(await File.ReadAllBytesAsync(path));
|
|
|
|
|
}
|
|
|
|
|
}
|