<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:vm="using:DodoSSH.Client.Shell.ViewModels"
             x:Class="DodoSSH.Client.App.Views.SessionHeader"
             x:Name="Root"
             x:DataType="vm:MainWindowViewModel">

  <!--
    ── v5b's session shell host header ──────────────────────────────────────────────────────────────────────
    60px, DeepChrome, atop the pane both the terminal and the SFTP surface hold. Per the design, minus the
    three deviations design-notes/v5b-fidelity-notes.md records: no OS label, no latency reading, no "Port
    forward" button — none of those are facts this application has.

    ◆ THE ONE FACT LEFT is the address, read off MainWindowViewModel.SessionAddress — which is already the
    surface-aware property, so this control asks no question about which screen it is on. What differs
    between the two usages is only the cross-surface button: <see cref="OpenLabel"/>, <see cref="OpenCommand"/>
    and the empty-state copy, all handed in from MainWindow.axaml rather than branched on here.
  -->

  <Border Height="60" Background="{StaticResource DeepChrome}"
          BorderBrush="{StaticResource Border}" BorderThickness="0,0,0,1">
    <Grid ColumnDefinitions="*,Auto" Margin="24,0,20,0">

      <!--
        The address, only while a session/host context is active — see SessionAddress's own remark for what
        "active" means on each surface. The empty state takes its place otherwise, in the idiom every other
        screen's own "nothing yet" sentence already uses: TextFaint, sentence case, no punctuation implying a
        form to fill in.
      -->
      <TextBlock Grid.Column="0" FontFamily="{StaticResource MonoFont}" FontWeight="Bold" FontSize="14"
                 Foreground="{StaticResource AccentText}" VerticalAlignment="Center"
                 Text="{Binding SessionAddress}" ToolTip.Tip="{Binding SessionAddress}"
                 TextTrimming="CharacterEllipsis"
                 IsVisible="{Binding SessionAddress, Converter={x:Static StringConverters.IsNotNullOrEmpty}}" />

      <TextBlock Grid.Column="0" Classes="mono" FontSize="12.5"
                 Foreground="{StaticResource TextFaint}" VerticalAlignment="Center"
                 Text="{Binding #Root.EmptyText}" TextTrimming="CharacterEllipsis"
                 IsVisible="{Binding SessionAddress, Converter={x:Static StringConverters.IsNullOrEmpty}}" />

      <Button Grid.Column="1" Classes="headerghost"
              Content="{Binding #Root.OpenLabel}"
              Command="{Binding #Root.OpenCommand}"
              CommandParameter="{Binding #Root.OpenCommandParameter}" />

    </Grid>
  </Border>

</UserControl>
