@inherits DbContextPage

<div class="rz-p-0 rz-p-md-12">
    <RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-p-4 rz-mb-6 rz-border-radius-1" Style="border: var(--rz-grid-cell-border);">
        <RadzenStack Gap="0.5rem" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
            <RadzenLabel Text="Disable form fields:" />
            <RadzenSwitch @bind-Value="disabled" />
        </RadzenStack>
        <RadzenStack Gap="0.5rem" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
            <RadzenLabel Text="Variant:" />
            <RadzenSelectBar @bind-Value="@variant" TextProperty="Text" ValueProperty="Value" Data="@(Enum.GetValues(typeof(Variant)).Cast<Variant>().Select(t => new { Text = $"{t}", Value = t }))" Size="ButtonSize.Small" class="rz-display-none rz-display-xl-flex" />
            <RadzenDropDown @bind-Value="@variant" TextProperty="Text" ValueProperty="Value" Data="@(Enum.GetValues(typeof(Variant)).Cast<Variant>().Select(t => new { Text = $"{t}", Value = t }))" class="rz-display-inline-flex rz-display-xl-none" />
        </RadzenStack>
    </RadzenStack>

    <RadzenStack Orientation="Orientation.Horizontal" Wrap="FlexWrap.Wrap" Gap="1rem">
        <RadzenFormField Text="RadzenTextBox" Variant="@variant" Style="flex: 1;">
            <RadzenTextBox @bind-Value="@value" Disabled="@disabled" />
        </RadzenFormField>
        <RadzenFormField Text="RadzenNumeric" Variant="@variant" Style="flex: 1;">
            <RadzenNumeric @bind-Value="@intValue" Disabled="@disabled" />
        </RadzenFormField>
        <RadzenFormField Text="RadzenPassword" Variant="@variant" Style="flex: 1;">
            <RadzenPassword @bind-Value="@value" Disabled="@disabled" />
        </RadzenFormField>
        <RadzenFormField Text="RadzenDropDown" Variant="@variant" Style="flex: 1;">
            <RadzenDropDown Data=@companyNames @bind-Value="@dropDownValue"  Disabled="@disabled" />
        </RadzenFormField>
    </RadzenStack>
</div>

@code {
    bool disabled = true;
    Variant variant = Variant.Outlined;

    string value = "Text";
    int intValue = 123;
    string dropDownValue = "Around the Horn";

    IEnumerable<string> companyNames;

    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();

        companyNames = dbContext.Customers.Select(c => c.CompanyName).Distinct();
    }
}