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