Iceshrimp.NET/Iceshrimp.Frontend/Components/Note/NoteAttachments.razor
2024-06-29 00:22:10 +02:00

20 lines
No EOL
666 B
Text

@using Iceshrimp.Shared.Schemas
<div class="attachment-container">
@foreach (var element in Attachments)
{
<div class="wrapper" @onclick="Open" @onclick:stopPropagation="true">
<img class="attachment" src="@element.Url" alt="@element.AltText"/>
</div>
}
<AttachmentView @ref="View" Attachments="Attachments"></AttachmentView>
</div>
@code {
[Parameter] [EditorRequired] public required IList<NoteAttachment> Attachments { get; set; }
private AttachmentView View { get; set; } = null!;
private async void Open()
{
await View.OpenDialog();
}
}