<?xml version="1.0" encoding="utf-8" ?>
<local:EpisodeCardPresenter
    x:Class="BiliCopilot.UI.Controls.Components.MomentEpisodePresenter"
    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="120"
        Padding="4"
        Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
        ColumnSpacing="12"
        CornerRadius="{StaticResource ControlCornerRadius}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="180" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <local:VideoCoverImage CornerRadius="{StaticResource ControlCornerRadius}" Source="{x:Bind ViewModel.Cover, Mode=OneWay}" />
        <Border
            Margin="4"
            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="0,8,12,8"
            RowSpacing="6">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <base:TrimTextBlock
                HorizontalAlignment="Left"
                VerticalAlignment="Top"
                FontWeight="Bold"
                Text="{x:Bind ViewModel.Title, Mode=OneWay}" />
            <StackPanel
                Grid.Row="1"
                Orientation="Horizontal"
                Spacing="12">
                <StackPanel
                    VerticalAlignment="Center"
                    Orientation="Horizontal"
                    Spacing="4"
                    ToolTipService.ToolTip="{ext:Locale Name=PlayCount}">
                    <ic:SymbolIcon
                        VerticalAlignment="Center"
                        FontSize="10"
                        Foreground="{ThemeResource AccentTextFillColorTertiaryBrush}"
                        Symbol="PlayCircle" />
                    <TextBlock
                        VerticalAlignment="Center"
                        Foreground="{ThemeResource TextFillColorTertiaryBrush}"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        Text="{x:Bind ViewModel.PlayCount, Converter={StaticResource CountConverter}, Mode=OneWay}"
                        TextLineBounds="Tight" />
                </StackPanel>
                <StackPanel
                    VerticalAlignment="Center"
                    Orientation="Horizontal"
                    Spacing="4"
                    ToolTipService.ToolTip="{ext:Locale Name=DanmakuCount}"
                    Visibility="{x:Bind ViewModel.DanmakuCount, Converter={StaticResource ObjectToVisibilityConverter}, Mode=OneWay}">
                    <ic:SymbolIcon
                        VerticalAlignment="Center"
                        FontSize="10"
                        Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                        Symbol="TextBulletList" />
                    <TextBlock
                        VerticalAlignment="Center"
                        Foreground="{ThemeResource TextFillColorTertiaryBrush}"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        Text="{x:Bind ViewModel.DanmakuCount, Converter={StaticResource CountConverter}, Mode=OneWay}"
                        TextLineBounds="Tight" />
                </StackPanel>
            </StackPanel>
        </Grid>
    </Grid>
</local:EpisodeCardPresenter>
