@using Microsoft.AspNetCore.Components.Web
@using Radzen.Blazor.Rendering
@using Radzen.Documents.Spreadsheet
@inherits CellBase

@{
#pragma warning disable IL2111
}

<div class=@Class style=@Style data-row=@Row data-column=@Column title=@GetValidationTooltip()>
    @if (customRendererType is not null)
    {
        <DynamicComponent Type=@customRendererType Parameters=@GetRendererParameters() />
    }
    else if (cell?.Hyperlink is not null)
    {
        <a class="rz-spreadsheet-cell-hyperlink" href=@cell.Hyperlink.Url target="_blank" @onclick:stopPropagation>@GetDisplayValue()</a>
    }
    else
    {
        @GetDisplayValue()
    }
    @if (showCellMenu)
    {
        <RadzenButton @ref=@cellMenuButton class="rz-spreadsheet-cell-chevron" Variant="Variant.Flat"
            ButtonStyle="ButtonStyle.Base" Size="ButtonSize.ExtraSmall" Icon="expand_more" Click=@OnToggleAsync />
    }
</div>