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

    <Grid Height="86" Background="{ThemeResource CardBackgroundFillColorDefaultBrush}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="120" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <local:VideoCoverImage
            Margin="6"
            VerticalAlignment="Stretch"
            CornerRadius="4"
            Source="{x:Bind ViewModel.Cover, Mode=OneWay}" />
        <Border
            Margin="8"
            Padding="4"
            HorizontalAlignment="Right"
            VerticalAlignment="Bottom"
            CornerRadius="{StaticResource ControlCornerRadius}">
            <Border.Background>
                <SolidColorBrush Opacity="0.6" Color="Black" />
            </Border.Background>
            <TextBlock
                Foreground="White"
                Style="{StaticResource CaptionTextBlockStyle}"
                Text="{x:Bind ViewModel.Duration, Mode=OneWay}" />
        </Border>
        <Grid
            Grid.Column="1"
            Padding="8,8,12,12"
            VerticalAlignment="Stretch"
            RowSpacing="6">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock
                Foreground="{ThemeResource TextFillColorTertiaryBrush}"
                Style="{StaticResource CaptionTextBlockStyle}"
                Text="{x:Bind ViewModel.HighlightText, Mode=OneWay}"
                Visibility="{x:Bind ViewModel.HighlightText, Converter={StaticResource ObjectToVisibilityConverter}, Mode=OneWay}" />
            <base:TrimTextBlock
                Grid.Row="1"
                HorizontalAlignment="Left"
                VerticalAlignment="Top"
                FontWeight="Bold"
                MaxLines="2"
                Text="{x:Bind ViewModel.Title, Mode=OneWay}" />
            <StackPanel
                Grid.Row="2"
                Orientation="Horizontal"
                Spacing="12">
                <StackPanel
                    VerticalAlignment="Center"
                    Orientation="Horizontal"
                    Spacing="4"
                    ToolTipService.ToolTip="{ext:Locale Name=LikeCount}">
                    <ic:SymbolIcon
                        VerticalAlignment="Center"
                        FontSize="10"
                        Foreground="{ThemeResource SystemFillColorCriticalBrush}"
                        Symbol="ThumbLike" />
                    <TextBlock
                        VerticalAlignment="Center"
                        Foreground="{ThemeResource TextFillColorTertiaryBrush}"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        Text="{x:Bind ViewModel.LikeCount, Converter={StaticResource CountConverter}, Mode=OneWay}"
                        TextLineBounds="Tight" />
                </StackPanel>
                <StackPanel
                    VerticalAlignment="Center"
                    Orientation="Horizontal"
                    Spacing="4"
                    ToolTipService.ToolTip="{ext:Locale Name=CoinCount}"
                    Visibility="{x:Bind ViewModel.CoinCount, Converter={StaticResource ObjectToVisibilityConverter}, Mode=OneWay}">
                    <ic:SymbolIcon
                        VerticalAlignment="Center"
                        FontSize="10"
                        Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                        Symbol="Blur" />
                    <TextBlock
                        VerticalAlignment="Center"
                        Foreground="{ThemeResource TextFillColorTertiaryBrush}"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        Text="{x:Bind ViewModel.CoinCount, Converter={StaticResource CountConverter}, Mode=OneWay}"
                        TextLineBounds="Tight" />
                </StackPanel>
            </StackPanel>
        </Grid>
    </Grid>
</local:EpisodeCardPresenter>
