Iceshrimp.NET/Iceshrimp.Frontend/Components/Note/NoteReaction.razor
2024-07-04 18:02:00 +02:00

26 lines
No EOL
692 B
Text

@using Iceshrimp.Shared.Schemas.Web
<button @onclick="React" class="reaction">
<span class="icon">
@if (Reaction.Url == null)
{
@Reaction.Name
}
@if (Reaction.Url != null)
{
<img class="custom-reaction" src="@Reaction.Url" alt="@Reaction.Name"/>
}
</span>
<span class="count">
@Reaction.Count
</span>
</button>
@code {
[Parameter] [EditorRequired] public required NoteReactionSchema Reaction { get; set; }
[CascadingParameter] Note Note { get; set; } = null!;
private void React()
{
Note.React(Reaction.Name, !Reaction.Reacted);
}
}