@*
T33b: body component for the "Move folder" dialog hosted by
IDialogService.ShowAsync. Renders ONLY the picker + action buttons inside the
host's .modal-body; the host owns the backdrop, header, and focus trap. The
body closes with a MoveFolderResult carrying the picked parent id (null = Root,
which is why a result record is used: Close(null) would otherwise be
indistinguishable from a Cancel). The parent validates after the dialog closes
and toasts any server guard failure.
*@
@code {
/// Host-supplied context used to close (with the picked parent id) or cancel.
[Parameter] public DialogContext Context { get; set; } = default!;
[Parameter] public IEnumerable<(int? Id, string Label)> FolderOptions { get; set; } = Array.Empty<(int?, string)>();
private int? _targetParentId;
private void Submit() => Context.Close(new MoveFolderResult(_targetParentId));
///
/// Result of the move-folder picker. A reference type so a non-null close is
/// distinguishable from a cancel even when the picked parent is null (Root):
/// ShowAsync resolves to this record on Move and to null on Cancel.
///
/// The chosen parent folder id, or null for Root.
public sealed record MoveFolderResult(int? NewParentId);
}