<v:ChromelessWindow 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:v="using:SourceGit.Views"
                    xmlns:vm="using:SourceGit.ViewModels"
                    xmlns:c="using:SourceGit.Converters"
                    mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="120"
                    x:Class="SourceGit.Views.AIAssistant"
                    x:Name="ThisControl"
                    Icon="/App.ico"
                    Title="{DynamicResource Text.AIAssistant}"
                    Width="520" SizeToContent="Height"
                    CanResize="False"
                    WindowStartupLocation="CenterOwner">
  <Grid RowDefinitions="Auto,Auto,Auto">
    <!-- TitleBar -->
    <Grid Grid.Row="0" Height="28" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}">
      <Border Background="{DynamicResource Brush.TitleBar}"
              BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}"
              PointerPressed="BeginMoveWindow"/>

      <Path Width="14" Height="14"
            Margin="10,0,0,0"
            HorizontalAlignment="Left"
            Data="{StaticResource Icons.AIAssist}"
            IsVisible="{OnPlatform True, macOS=False}"/>

      <TextBlock Classes="bold"
                 Text="{DynamicResource Text.AIAssistant}"
                 HorizontalAlignment="Center" VerticalAlignment="Center"
                 IsHitTestVisible="False"/>

      <v:CaptionButtons HorizontalAlignment="Right"
                        IsCloseButtonOnly="True"
                        IsVisible="{OnPlatform True, macOS=False}"/>
    </Grid>

    <!-- AI response -->
    <v:AIResponseView Grid.Row="1"
                      x:Name="TxtResponse"
                      Margin="8"
                      Height="320"
                      BorderThickness="1"
                      BorderBrush="{DynamicResource Brush.Border2}"
                      Background="{DynamicResource Brush.Contents}"/>

    <!-- Options -->
    <Border Grid.Row="2" Margin="0,0,0,8">
      <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
        <v:LoadingIcon x:Name="IconInProgress" Width="14" Height="14" Margin="0,0,8,0"/>
        <Button Classes="flat"
                x:Name="BtnGenerateCommitMessage"
                Height="28"
                Margin="0,0,8,0"
                Padding="12,0"
                Content="{DynamicResource Text.AIAssistant.Use}"
                Click="OnGenerateCommitMessage"/>
        <Button Classes="flat"
                x:Name="BtnRegenerate"
                Height="28"
                Padding="12,0"
                Content="{DynamicResource Text.AIAssistant.Regen}"
                Click="OnRegen"/>
      </StackPanel>
    </Border>
  </Grid>
</v:ChromelessWindow>
