mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 20:27:21 +00:00
35 lines
1.3 KiB
C#
35 lines
1.3 KiB
C#
using AIStudio.Components;
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AIStudio.Assistants.SWOTAnalysis;
|
|
|
|
/// <summary>
|
|
/// Shows how far the analysis of each SWOT category is, and its findings as soon as they are there.
|
|
/// </summary>
|
|
public partial class SwotAnalysisProgressView : MSGComponentBase
|
|
{
|
|
/// <summary>
|
|
/// The progress per category; a category without one counts as running.
|
|
/// </summary>
|
|
[Parameter, EditorRequired]
|
|
public IReadOnlyDictionary<SwotAnalysisCategory, SwotCategoryAnalysisProgress> Progress { get; set; } = null!;
|
|
|
|
private static readonly SwotCategoryAnalysisProgress RUNNING = new(SwotCategoryAnalysisStatus.RUNNING);
|
|
|
|
private SwotCategoryAnalysisProgress ProgressOf(SwotAnalysisCategory category) => this.Progress.GetValueOrDefault(category, RUNNING);
|
|
|
|
private string RunningTextOf(SwotCategoryAnalysisStatus status) => status is SwotCategoryAnalysisStatus.REPAIRING
|
|
? T("The answer did not have the expected form. Asking the model once more...")
|
|
: T("Analyzing this category...");
|
|
|
|
private SwotQuadrantLabels Labels => new(
|
|
T("Strengths"),
|
|
T("Weaknesses"),
|
|
T("Opportunities"),
|
|
T("Threats"),
|
|
T("Internal"),
|
|
T("External"),
|
|
T("Positive"),
|
|
T("Negative"));
|
|
} |