diff --git a/app/MindWork AI Studio/Components/TextInfoLine.razor b/app/MindWork AI Studio/Components/TextInfoLine.razor new file mode 100644 index 0000000..b3bf2ba --- /dev/null +++ b/app/MindWork AI Studio/Components/TextInfoLine.razor @@ -0,0 +1,18 @@ + + + + @if (this.ShowingCopyButton) + { + + + + } + \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/TextInfoLine.razor.cs b/app/MindWork AI Studio/Components/TextInfoLine.razor.cs new file mode 100644 index 0000000..a68f25f --- /dev/null +++ b/app/MindWork AI Studio/Components/TextInfoLine.razor.cs @@ -0,0 +1,31 @@ +using Microsoft.AspNetCore.Components; + +namespace AIStudio.Components; + +public partial class TextInfoLine : ComponentBase +{ + [Parameter] + public string Label { get; set; } = string.Empty; + + [Parameter] + public string Icon { get; set; } = Icons.Material.Filled.Info; + + [Parameter] + public string Value { get; set; } = string.Empty; + + [Parameter] + public string ClipboardTooltipSubject { get; set; } = "the text"; + + [Parameter] + public bool ShowingCopyButton { get; set; } = true; + + [Inject] + private RustService RustService { get; init; } = null!; + + [Inject] + private ISnackbar Snackbar { get; init; } = null!; + + private string ClipboardTooltip => $"Copy {this.ClipboardTooltipSubject} to the clipboard"; + + private async Task CopyToClipboard(string content) => await this.RustService.CopyText2Clipboard(this.Snackbar, content); +} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor b/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor index 828abf5..6fb4b12 100644 --- a/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor +++ b/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor @@ -1,37 +1,8 @@ - - - - - - - + - - - - - - - - + @if (!this.IsFileAvailable) { @@ -45,22 +16,7 @@ } - - - - - - - - + @if (this.IsCloudEmbedding) { @@ -75,21 +31,7 @@ } - - - - - - - + Close diff --git a/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor.cs b/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor.cs index 23fa068..a4a5c4a 100644 --- a/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor.cs +++ b/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor.cs @@ -13,12 +13,6 @@ public partial class DataSourceLocalFileInfoDialog : ComponentBase [Parameter] public DataSourceLocalFile DataSource { get; set; } - [Inject] - private RustService RustService { get; init; } = null!; - - [Inject] - private ISnackbar Snackbar { get; init; } = null!; - [Inject] private SettingsManager SettingsManager { get; init; } = null!; @@ -42,7 +36,5 @@ public partial class DataSourceLocalFileInfoDialog : ComponentBase private string FileSize => this.fileInfo.FileSize(); - private async Task CopyToClipboard(string content) => await this.RustService.CopyText2Clipboard(this.Snackbar, content); - private void Close() => this.MudDialog.Close(); } \ No newline at end of file