From 3b2770dd5cc24a7bc21cb57a9db30b08a35f3e6b Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 1 Feb 2026 14:13:30 +0100 Subject: [PATCH] Allow to disable the component --- app/MindWork AI Studio/Components/ReadFileContent.razor | 4 ++-- .../Components/ReadFileContent.razor.cs | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/MindWork AI Studio/Components/ReadFileContent.razor b/app/MindWork AI Studio/Components/ReadFileContent.razor index 05a63722..302224de 100644 --- a/app/MindWork AI Studio/Components/ReadFileContent.razor +++ b/app/MindWork AI Studio/Components/ReadFileContent.razor @@ -1,5 +1,5 @@ @inherits MSGComponentBase - + @if (string.IsNullOrWhiteSpace(this.Text)) { @T("Use file content as input") @@ -8,4 +8,4 @@ { @this.Text } - \ No newline at end of file + diff --git a/app/MindWork AI Studio/Components/ReadFileContent.razor.cs b/app/MindWork AI Studio/Components/ReadFileContent.razor.cs index 5db85e21..d3248937 100644 --- a/app/MindWork AI Studio/Components/ReadFileContent.razor.cs +++ b/app/MindWork AI Studio/Components/ReadFileContent.razor.cs @@ -15,6 +15,9 @@ public partial class ReadFileContent : MSGComponentBase [Parameter] public EventCallback FileContentChanged { get; set; } + + [Parameter] + public bool Disabled { get; set; } [Inject] private RustService RustService { get; init; } = null!; @@ -30,6 +33,9 @@ public partial class ReadFileContent : MSGComponentBase private async Task SelectFile() { + if (this.Disabled) + return; + // Ensure that Pandoc is installed and ready: var pandocState = await this.PandocAvailabilityService.EnsureAvailabilityAsync( showSuccessMessage: false, @@ -73,4 +79,4 @@ public partial class ReadFileContent : MSGComponentBase await MessageBus.INSTANCE.SendError(new(Icons.Material.Filled.Error, T("Failed to load file content"))); } } -} \ No newline at end of file +}