using Avalonia;
using Avalonia.Controls;

namespace DodoSSH.Client.App.Views;

/// <summary>
/// The v5b session shell's status bar: CONNECTED and its dot, the negotiated cipher, the host key's algorithm
/// and — where one authenticated — the identity that did, the elapsed timer, and — only where it is true —
/// UTF-8. See the remark at the top of SessionStatusBar.axaml.
/// </summary>
internal sealed partial class SessionStatusBar : UserControl
{
    /// <summary>
    /// Whether "UTF-8" is drawn on the right.
    /// </summary>
    /// <remarks>
    /// Set true only by the terminal surface's own usage in <c>MainWindow.axaml</c>. It is a fact about this
    /// client's renderer and its write path — see the remark on <c>SessionStatusBar.axaml</c> — and has
    /// nothing to do with an SFTP session, which moves bytes rather than decoded text.
    /// </remarks>
    internal static readonly StyledProperty<bool> ShowsEncodingProperty =
        AvaloniaProperty.Register<SessionStatusBar, bool>(nameof(ShowsEncoding));

    public SessionStatusBar() => InitializeComponent();

    internal bool ShowsEncoding
    {
        get => GetValue(ShowsEncodingProperty);
        set => SetValue(ShowsEncodingProperty, value);
    }
}
