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

    <controls:CardPanel Click="OnSessionClick">
        <controls:CardPanel.ContextFlyout>
            <MenuFlyout>
                <MenuFlyoutItem Click="OnCopyItemClick" Text="{ext:Locale Name=CopyImage}">
                    <MenuFlyoutItem.Icon>
                        <ic:SymbolIcon Symbol="Copy" />
                    </MenuFlyoutItem.Icon>
                </MenuFlyoutItem>
                <MenuFlyoutItem Click="OnOpenItemClick" Text="{ext:Locale Name=OpenImage}">
                    <MenuFlyoutItem.Icon>
                        <ic:SymbolIcon Symbol="Image" />
                    </MenuFlyoutItem.Icon>
                </MenuFlyoutItem>
                <MenuFlyoutSeparator />
                <MenuFlyoutItem Click="OnDeleteItemClick" Text="{ext:Locale Name=Delete}">
                    <MenuFlyoutItem.Icon>
                        <ic:SymbolIcon Foreground="{ThemeResource SystemFillColorCriticalBrush}" Symbol="Delete" />
                    </MenuFlyoutItem.Icon>
                </MenuFlyoutItem>
            </MenuFlyout>
        </controls:CardPanel.ContextFlyout>
        <Grid Margin="16,12" RowSpacing="8">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock
                x:Name="PromptBlock"
                Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                MaxLines="2"
                Style="{StaticResource CaptionTextBlockStyle}"
                Text="{x:Bind ViewModel.Data.Request.Prompt, Mode=OneWay}"
                TextTrimming="CharacterEllipsis"
                TextWrapping="Wrap">
                <ToolTipService.ToolTip>
                    <ToolTip Content="{x:Bind ViewModel.Data.Request.Prompt, Mode=OneWay}" IsEnabled="{x:Bind PromptBlock.IsTextTrimmed, Mode=OneWay}" />
                </ToolTipService.ToolTip>
            </TextBlock>
            <local:LocalDrawImage
                x:Name="DisplayImage"
                Grid.Row="1"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Id="{x:Bind ViewModel.Data.Id, Mode=OneWay}"
                SizeChanged="OnImageSizeChanged" />
            <Grid Grid.Row="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <controls:ProviderLogo
                    Width="20"
                    Height="20"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center"
                    AvatarPadding="4"
                    IsAvatar="True"
                    Provider="{x:Bind ViewModel.Data.Provider, Mode=OneWay}" />
                <TextBlock
                    x:Name="DateBlock"
                    Grid.Column="1"
                    VerticalAlignment="Center"
                    Foreground="{ThemeResource TextFillColorTertiaryBrush}"
                    Style="{StaticResource CaptionTextBlockStyle}" />
            </Grid>
        </Grid>
    </controls:CardPanel>

</local:DrawSessionItemControlBase>
