Files
SilverMetal/windows/welcome/src/SilverOS.Welcome.UI/Components/Steps/FlavourStep.razor
sysadmin 6d6eb2cdc8 fix(welcome): FlavourStep notifies host on select so Next enables immediately
WIP on local branch feat/wizard-recipes (NOT pushed) — holding per operator while
more wizard changes (role app-recipes) are designed.
2026-06-09 21:45:20 +01:00

38 lines
1.2 KiB
Plaintext

@inject WizardState State
<div class="step flavour-step">
<h1>What's this device for?</h1>
<p class="step-subtitle">Choose the flavour that best matches how this PC will be used.</p>
<div class="flavour-grid">
@foreach (var f in Flavours)
{
<div class="flavour-card @(State.Flavour?.Id == f.Id ? "selected" : "")"
data-id="@f.Id"
@onclick="() => Select(f)">
<h3>@f.Label</h3>
<p>@f.Description</p>
</div>
}
</div>
</div>
@code {
[Parameter] public IReadOnlyList<FlavourManifest> Flavours { get; set; } = Array.Empty<FlavourManifest>();
/// <summary>Notifies the wizard host when the selection changes so it re-evaluates
/// the Next button (otherwise Next stays disabled until a back/forward re-render).</summary>
[Parameter] public EventCallback OnSelected { get; set; }
protected override async Task OnInitializedAsync()
{
State.Flavour ??= Flavours.FirstOrDefault(f => f.IsDefault);
await OnSelected.InvokeAsync();
}
async Task Select(FlavourManifest f)
{
State.Flavour = f;
await OnSelected.InvokeAsync();
}
}