<?xml version="1.0" encoding="utf-8" ?>
<base:LayoutUserControlBase
    x:Class="BiliCopilot.UI.Controls.Player.UpSectionControl"
    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:components="using:BiliCopilot.UI.Controls.Components"
    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.Player"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <base:CardControl
        Background="Transparent"
        BorderBrush="Transparent"
        BorderThickness="0"
        Command="{x:Bind ActiveCommand, Mode=OneWay}">
        <Grid Padding="12,8" ColumnSpacing="16">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <PersonPicture
                Width="44"
                Height="44"
                VerticalAlignment="Center"
                DisplayName="{x:Bind UserName, Mode=OneWay}"
                ProfilePicture="{x:Bind Avatar, Mode=OneWay, Converter={StaticResource BitmapConverter}}" />
            <StackPanel
                Grid.Column="1"
                VerticalAlignment="Center"
                Spacing="4">
                <base:TrimTextBlock
                    FontWeight="Bold"
                    MaxLines="1"
                    Text="{x:Bind UserName, Mode=OneWay}" />
                <TextBlock
                    HorizontalAlignment="Left"
                    Foreground="{ThemeResource TextFillColorTertiaryBrush}"
                    Style="{StaticResource CaptionTextBlockStyle}"
                    Text="{x:Bind Subtitle, Mode=OneWay}" />
            </StackPanel>
            <Button
                Grid.Column="2"
                Margin="8,0,0,0"
                Padding="8"
                VerticalAlignment="Center"
                Command="{x:Bind ToggleFollowCommand, Mode=OneWay}"
                Visibility="{x:Bind IsFollowButtonShown, Mode=OneWay}">
                <StackPanel Orientation="Horizontal" Spacing="8">
                    <ic:SymbolIcon
                        VerticalAlignment="Center"
                        FontSize="14"
                        IconVariant="{x:Bind IsFollow, Mode=OneWay, Converter={StaticResource BoolToIconVariantConverter}}"
                        Symbol="Heart" />
                </StackPanel>
            </Button>
        </Grid>
    </base:CardControl>

</base:LayoutUserControlBase>
