using AIStudio.Components; using Microsoft.AspNetCore.Components; namespace AIStudio.Assistants.SWOTAnalysis; /// /// Shows how far the analysis of each SWOT category is, and its findings as soon as they are there. /// public partial class SwotAnalysisProgressView : MSGComponentBase { /// /// The progress per category; a category without one counts as running. /// [Parameter, EditorRequired] public IReadOnlyDictionary 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")); }