@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 => DATA.Get()[EntityId];

    void EntityLabelClicked()
    {
        entityDialogService.AddDialog(EntityId);
    }

}