using VisionBuilder.UI.Common.ViewModel;
using VisionBuilder.UI.Common.ViewModel.Interfaces.UI;
using VisionBuilder.UI.Windows.Dialogs;

namespace VisionBuilder.UI.Windows.Settings;

public class WindowsRecipeSelectionDialogService: IRecipeSelectionDialogService
{
    private readonly IRecipeCreationTool _recipeCreationTool;

    public WindowsRecipeSelectionDialogService(IRecipeCreationTool recipeCreationTool)
    {
        _recipeCreationTool = recipeCreationTool;
    }

    public Task<bool> SelectRecipeAsync(RecipeSelectionVM recipeSelectionVm)
    {
        RecipeSelectionDialog dialog = new RecipeSelectionDialog(recipeSelectionVm, _recipeCreationTool);
        return Task.FromResult(dialog.ShowDialog() == DialogResult.OK);
    }
}