65 lines
No EOL
1.9 KiB
Text
65 lines
No EOL
1.9 KiB
Text
@using Iceshrimp.Frontend.Localization
|
|
@using Iceshrimp.Shared.Schemas.Web
|
|
@using Microsoft.Extensions.Localization
|
|
@using Iceshrimp.Assets.PhosphorIcons
|
|
@inject IStringLocalizer<Localization> Loc;
|
|
@inject NavigationManager Nav;
|
|
|
|
@if (File != null && Folder == null)
|
|
{
|
|
<div class="drive-entry" @onclick="SelectFile" @onclick:stopPropagation="true">
|
|
<div class="labels">
|
|
@if (File.Description != null)
|
|
{
|
|
<Icon Name="Icons.ClosedCaptioning" title="@Loc["Has alt text"]"/>
|
|
}
|
|
else
|
|
{
|
|
<Icon Name="Icons.Warning" title="@Loc["No alt text"]"/>
|
|
}
|
|
@if (File.Sensitive)
|
|
{
|
|
<Icon Name="Icons.EyeSlash" title="@Loc["Sensitive"]"/>
|
|
}
|
|
</div>
|
|
@if (File.ContentType.StartsWith("image"))
|
|
{
|
|
<img class="thumbnail" src="@File.ThumbnailUrl" alt="@File.Description"/>
|
|
}
|
|
else if (File.ContentType.StartsWith("audio"))
|
|
{
|
|
<Icon Name="Icons.FileAudio" Size="5em"/>
|
|
}
|
|
else if (File.ContentType.StartsWith("video"))
|
|
{
|
|
<Icon Name="Icons.FileVideo" Size="5em"/>
|
|
}
|
|
else
|
|
{
|
|
<Icon Name="Icons.File" Size="5em"/>
|
|
}
|
|
<span>@File.Filename</span>
|
|
</div>
|
|
}
|
|
@if (Folder != null && File == null)
|
|
{
|
|
<div class="drive-entry" @onclick="SelectFolder" @onclick:stopPropagation="true">
|
|
<Icon Name="Icons.FolderOpen" Size="5em" Pack="IconStyle.Fill"/>
|
|
<span>@Folder.Name</span>
|
|
</div>
|
|
}
|
|
|
|
@code {
|
|
[Parameter] public DriveFileResponse? File { get; set; } = null;
|
|
[Parameter] public DriveFolderResponse? Folder { get; set; } = null;
|
|
|
|
private void SelectFile()
|
|
{
|
|
|
|
}
|
|
|
|
private void SelectFolder()
|
|
{
|
|
Nav.NavigateTo($"/drive/{Folder!.Id}");
|
|
}
|
|
} |