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

26 lines
No EOL
685 B
Text

@using Iceshrimp.Shared.Schemas
<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] NoteComponent NoteComponent { get; set; } = null!;
private void React()
{
NoteComponent.React(Reaction.Name, !Reaction.Reacted);
}
}