using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace AxCopilot.Views; internal static class AgentPreviewSurfaceFactory { internal static Border CreateSurface( string title, string summary, UIElement body, Brush primary, Brush secondary, Brush itemBackground, Brush borderBrush, Thickness? margin = null) { return new Border { Background = itemBackground, BorderBrush = borderBrush, BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(12), Padding = new Thickness(12, 10, 12, 10), Margin = margin ?? new Thickness(0, 8, 0, 0), Child = new StackPanel { Children = { new TextBlock { Text = title, FontSize = 12, FontWeight = FontWeights.SemiBold, Foreground = primary, }, new TextBlock { Text = summary, FontSize = 11, Foreground = secondary, Margin = new Thickness(0, 2, 0, 8), TextWrapping = TextWrapping.Wrap, }, body } } }; } internal static Border CreatePreviewBox( string content, Brush primary, Brush secondary, Brush borderBrush, double maxHeight, bool monospace = true) { var panel = new Border { Background = Brushes.Transparent, BorderBrush = new SolidColorBrush(Color.FromArgb(0x20, 0x80, 0x80, 0x80)), BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(8), Padding = new Thickness(8, 6, 8, 6), Child = new ScrollViewer { MaxHeight = maxHeight, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, Content = new TextBlock { Text = string.IsNullOrWhiteSpace(content) ? "(empty)" : content, Foreground = primary, FontFamily = monospace ? new FontFamily("Consolas") : new FontFamily("Pretendard"), FontSize = 11.2, TextWrapping = TextWrapping.Wrap, LineHeight = 18, } } }; return panel; } }