<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:vm="using:SourceGit.ViewModels"
             xmlns:v="using:SourceGit.Views"
             xmlns:c="using:SourceGit.Converters"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="SourceGit.Views.SquashOrFixupHead"
             x:DataType="vm:SquashOrFixupHead">
  <StackPanel Orientation="Vertical" Margin="8,0">
    <StackPanel Orientation="Horizontal" IsVisible="{Binding !IsFixupMode}">
      <Path Width="16" Height="16"
            Data="{StaticResource Icons.SquashIntoParent}"/>

      <TextBlock FontSize="18"
                 Margin="8,0,0,0"
                 Classes="bold"
                 Text="{DynamicResource Text.SquashOrFixup.Squash}"/>
    </StackPanel>

    <StackPanel Orientation="Horizontal" IsVisible="{Binding IsFixupMode}">
      <Path Width="16" Height="16"
            Data="{StaticResource Icons.Fix}"/>

      <TextBlock FontSize="18"
                 Margin="8,0,0,0"
                 Classes="bold"
                 Text="{DynamicResource Text.SquashOrFixup.Fixup}"/>
    </StackPanel>

    <Grid Margin="0,18,0,0" ColumnDefinitions="Auto,Auto,Auto,*">
      <TextBlock Grid.Column="0"
                 Text="{DynamicResource Text.SquashOrFixup.Into}"/>
      <Path Grid.Column="1"
            Margin="8,0"
            Width="14" Height="14"
            Fill="{DynamicResource Brush.FG1}"
            Data="{StaticResource Icons.Commit}"/>
      <TextBlock Grid.Column="2"
                 Text="{Binding Target.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"
                 Foreground="DarkOrange"/>
      <TextBlock Grid.Column="3" Margin="8,0,0,0" Text="{Binding Target.Subject}" TextTrimming="CharacterEllipsis"/>
    </Grid>

    <v:CommitMessageToolBox Height="120" Margin="0,4,0,0" CommitMessage="{Binding Message, Mode=TwoWay}"/>
  </StackPanel>
</UserControl>
