exchanging the old word export with the new document export

This commit is contained in:
krut_ni 2026-07-28 17:38:45 +02:00
parent 9896222d39
commit 52b778c990
No known key found for this signature in database
GPG Key ID: A5C0151B4DDB172C

View File

@ -34,6 +34,8 @@ public partial class ContentBlockComponent : MSGComponentBase, IAsyncDisposable
"<svg", "<svg",
]; ];
private static readonly ILogger LOGGER = Program.LOGGER_FACTORY.CreateLogger(nameof(ContentBlockComponent));
/// <summary> /// <summary>
/// The role of the chat content block. /// The role of the chat content block.
/// </summary> /// </summary>
@ -546,9 +548,17 @@ public partial class ContentBlockComponent : MSGComponentBase, IAsyncDisposable
await this.RemoveBlockFunc(this.Content); await this.RemoveBlockFunc(this.Content);
} }
private async Task ExportToWord() private async Task ExportDocument(FileExportFormat format)
{ {
await PandocExport.ToMicrosoftWord(this.RustService, this.DialogService, T("Export Chat to Microsoft Word"), this.Content); try
{
await PandocExport.ToDocument(this.RustService, this.DialogService, format, this.Content);
}
catch (ArgumentOutOfRangeException e)
{
await this.MessageBus.SendError(new(Icons.Material.Filled.Error, string.Format(this.T("Failed to export document to unknown file format '{0}'."), format)));
LOGGER.LogError($"Failed to export document, because the format ('{format}') is unknown to our Pandoc service:\n{e}");
}
} }
private async Task RegenerateBlock() private async Task RegenerateBlock()