<?xml version="1.0" encoding="utf-8" ?>
<local:ChatProviderOptionPanelBase
    x:Class="RodelAgent.UI.Controls.Chat.ChatProviderOptionPanel"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:CommunityToolkit.WinUI.Controls"
    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.Chat"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <UserControl.Resources>
        <DataTemplate x:Name="ItemTemplate">
            <Grid
                Margin="12,0"
                Padding="0,8"
                BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
                BorderThickness="0,0,0,1"
                ColumnSpacing="8">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <TextBlock
                    VerticalAlignment="Center"
                    Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                    Style="{StaticResource CaptionTextBlockStyle}" />
                <ContentPresenter Grid.Column="1" VerticalAlignment="Center" />
            </Grid>
        </DataTemplate>
        <DataTemplate x:Name="TextTemplate">
            <StackPanel
                Margin="12,0"
                Padding="0,8"
                BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
                BorderThickness="0,0,0,1"
                Spacing="8">
                <TextBlock
                    HorizontalAlignment="Left"
                    Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                    Style="{StaticResource CaptionTextBlockStyle}" />
                <TextBox
                    HorizontalAlignment="Stretch"
                    AcceptsReturn="True"
                    TextWrapping="Wrap" />
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>

    <ScrollViewer
        Margin="0,8,0,0"
        Padding="8,0"
        Style="{StaticResource PageScrollViewerStyle}">
        <StackPanel x:Name="ControlPanel" Margin="0,0,0,12">
            <StackPanel x:Name="BasicPanel" Visibility="{x:Bind BasicPanelVisibility, Mode=OneWay}">
                <Grid
                    Margin="12,0"
                    Padding="0,2"
                    BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
                    BorderThickness="0,0,0,1"
                    ColumnSpacing="8">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <TextBlock
                        VerticalAlignment="Center"
                        Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        Text="{ext:Locale Name=StreamOutput}"
                        ToolTipService.ToolTip="{ext:Locale Name=StreamOutputDescription}" />
                    <ToggleSwitch
                        x:Name="StreamOutputSwitch"
                        Grid.Column="1"
                        MinWidth="0"
                        VerticalAlignment="Center"
                        Toggled="OnStreamOutputChanged" />
                </Grid>
                <Grid
                    Margin="12,0"
                    Padding="0,4"
                    BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
                    BorderThickness="0,0,0,1"
                    ColumnSpacing="8">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <TextBlock
                        VerticalAlignment="Center"
                        Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        Text="{ext:Locale Name=ChatTurn}"
                        ToolTipService.ToolTip="{ext:Locale Name=MaxTurnDescription}" />
                    <Slider
                        x:Name="MaxTurnSlider"
                        Grid.Column="1"
                        MinWidth="120"
                        HorizontalAlignment="Stretch"
                        AutomationProperties.Name="{ext:Locale Name=ChatTurn}"
                        IsEnabled="{x:Bind IsMaxRoundEnabled, Mode=OneWay}"
                        Maximum="10"
                        Minimum="0"
                        StepFrequency="1"
                        ValueChanged="OnChatTruenChanged" />
                </Grid>
            </StackPanel>
            <StackPanel x:Name="CustomPanel" />
        </StackPanel>
    </ScrollViewer>

</local:ChatProviderOptionPanelBase>
