<?xml version="1.0" encoding="utf-8" ?>
<local:LiveCardPresenter
    x:Class="BiliCopilot.UI.Controls.Components.RecommendLivePresenter"
    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>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="82" />
        </Grid.RowDefinitions>
        <local:VideoCoverImage CornerRadius="4,4,0,0" Source="{x:Bind ViewModel.Cover, Mode=OneWay}" />
        <Border
            Margin="8"
            Padding="4"
            HorizontalAlignment="Left"
            VerticalAlignment="Bottom"
            CornerRadius="{StaticResource ControlCornerRadius}">
            <Border.Background>
                <SolidColorBrush Opacity="0.55" Color="Black" />
            </Border.Background>
            <TextBlock
                Foreground="White"
                Style="{StaticResource CaptionTextBlockStyle}"
                Text="{x:Bind ViewModel.Subtitle, Mode=OneWay}" />
        </Border>
        <Grid
            Grid.Row="1"
            Padding="12,8,12,12"
            RowSpacing="6">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid ColumnSpacing="8">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <base:TrimTextBlock
                    VerticalAlignment="Center"
                    FontSize="12"
                    Foreground="{ThemeResource TextFillColorTertiaryBrush}"
                    Text="{x:Bind ViewModel.Author, Mode=OneWay}" />
                <StackPanel
                    Grid.Column="1"
                    VerticalAlignment="Center"
                    Orientation="Horizontal"
                    Spacing="4"
                    ToolTipService.ToolTip="{ext:Locale Name=Viewer}">
                    <ic:SymbolIcon
                        VerticalAlignment="Center"
                        FontSize="10"
                        Foreground="{ThemeResource AccentTextFillColorTertiaryBrush}"
                        Symbol="Eye" />
                    <TextBlock
                        VerticalAlignment="Center"
                        FontSize="10"
                        Foreground="{ThemeResource TextFillColorTertiaryBrush}"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        Text="{x:Bind ViewModel.ViewerCount, Converter={StaticResource CountConverter}, Mode=OneWay}"
                        TextLineBounds="Tight" />
                </StackPanel>
            </Grid>

            <base:TrimTextBlock
                Grid.Row="1"
                HorizontalAlignment="Left"
                Text="{x:Bind ViewModel.Title, Mode=OneWay}" />
        </Grid>
    </Grid>
</local:LiveCardPresenter>
