<?xml version="1.0" encoding="utf-8" ?>
<local:PromptTestPageControlBase
    x:Class="RodelAgent.UI.Controls.Internal.PromptTestMainHeader"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:base="using:Richasy.WinUI.Share.Base"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ext="using:RodelAgent.UI.Extensions"
    xmlns:ic="using:FluentIcons.WinUI"
    xmlns:local="using:RodelAgent.UI.Controls.Internal"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Padding="16,0" ColumnSpacing="8">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <TextBlock
            HorizontalAlignment="Left"
            VerticalAlignment="Center"
            Style="{StaticResource BodyStrongTextBlockStyle}"
            Text="{ext:Locale Name=InstructionAndTemplate}" />
        <SelectorBar
            x:Name="PromptSelector"
            Grid.Column="1"
            HorizontalAlignment="Center"
            SelectionChanged="OnPromptSelectionChanged" />
        <StackPanel
            Grid.Column="2"
            VerticalAlignment="Center"
            Orientation="Horizontal">
            <Button
                Command="{x:Bind ViewModel.ReloadMessagesCommand}"
                IsEnabled="{x:Bind ViewModel.IsGenerating, Mode=OneWay, Converter={StaticResource ObjectToBoolReverseConverter}}"
                Style="{StaticResource IconButtonStyle}"
                ToolTipService.ToolTip="{ext:Locale Name=Reload}"
                Visibility="{x:Bind ViewModel.CurrentSystemPrompt, Mode=OneWay, Converter={StaticResource ObjectToVisibilityConverter}}">
                <ic:SymbolIcon FontSize="14" Symbol="ArrowClockwise" />
                <Button.KeyboardAccelerators>
                    <KeyboardAccelerator
                        Key="R"
                        IsEnabled="True"
                        Modifiers="Control" />
                </Button.KeyboardAccelerators>
            </Button>
            <Button
                Command="{x:Bind ViewModel.SaveHistoryJsonCommand}"
                IsEnabled="{x:Bind ViewModel.IsGenerating, Mode=OneWay, Converter={StaticResource ObjectToBoolReverseConverter}}"
                Style="{StaticResource IconButtonStyle}"
                ToolTipService.ToolTip="{ext:Locale Name=SaveAs}"
                Visibility="{x:Bind ViewModel.CurrentSystemPrompt, Mode=OneWay, Converter={StaticResource ObjectToVisibilityConverter}}">
                <ic:SymbolIcon FontSize="14" Symbol="Save" />
                <Button.KeyboardAccelerators>
                    <KeyboardAccelerator
                        Key="S"
                        IsEnabled="True"
                        Modifiers="Control" />
                </Button.KeyboardAccelerators>
            </Button>
        </StackPanel>
    </Grid>
</local:PromptTestPageControlBase>
