<div class="folder-label">
    @Model.Name
</div>

@code {

    [Parameter, EditorRequired]
    public IHierachyItemModel Model { get; set; } = default!;

    protected override void OnAfterRender(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        if (firstRender)
        {
            Model.OnNameChanged += StateHasChanged;
        }
    }

    public void Dispose()
    {
        Model.OnNameChanged -= StateHasChanged;
        GC.SuppressFinalize(this);
    }
}
