Files
IGP-Fan-Reference/Components/Inputs/EntityLabelComponent.razor

26 lines
516 B
Plaintext

@using Model.Entity
@using Model.Entity.Data
@inject IEntityDialogService entityDialogService
@if (EntityId == null)
{
<div>Add a entity</div>
}
else
{
<button class="entityLabel @Entity.Descriptive.ToLower()" @onclick="EntityLabelClicked">@Entity.Info().Name</button>
}
@code {
[Parameter] public string EntityId { get; set; } = default!;
private EntityModel Entity => EntityData.Get()[EntityId];
void EntityLabelClicked()
{
entityDialogService.AddDialog(EntityId);
}
}