using Avalonia;
using Avalonia.Controls;

namespace DodoSSH.Client.App.Views;

/// <summary>
/// The v5b session sidebar: QUICK ACCESS on both surfaces, SNIPS on the terminal's own. See the remark at
/// the top of SessionSidebar.axaml.
/// </summary>
internal sealed partial class SessionSidebar : UserControl
{
    /// <summary>Whether the SNIPS section draws below QUICK ACCESS.</summary>
    /// <remarks>
    /// Set from the usage site rather than inferred from a surface flag on the shell, for the same reason
    /// <see cref="SessionTabRow.TabCommand"/> is: which sections a particular instance of this control shows
    /// is a fact about where it was placed in <c>MainWindow.axaml</c>, not one this control can read off its
    /// own <c>DataContext</c>.
    /// </remarks>
    internal static readonly StyledProperty<bool> ShowsSnipsProperty =
        AvaloniaProperty.Register<SessionSidebar, bool>(nameof(ShowsSnips));

    public SessionSidebar() => InitializeComponent();

    internal bool ShowsSnips
    {
        get => GetValue(ShowsSnipsProperty);
        set => SetValue(ShowsSnipsProperty, value);
    }
}
