@using CMSMicroservice.Protobuf.Protos.Commission

<MudAutocomplete T="WeekInfo"
                 Label="@Label"
                 Value="@_selectedWeek"
                 DebounceInterval="300"
                 ValueChanged="@OnSelected"
                 ToStringFunc="@(e => e?.DisplayName ?? string.Empty)"
                 SearchFunc="@Search"
                 Variant="Variant.Outlined"
                 Clearable="true"
                 ShowProgressIndicator="true"
                 CoerceText="@CoerceText"
                 ResetValueOnEmptyText="true"
                 OnClearButtonClick="@OnClear">
    <ItemTemplate Context="week">
        <MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
            <MudText>@week.DisplayText</MudText>
        </MudStack>
    </ItemTemplate>
</MudAutocomplete>
