<?xml version="1.0" encoding="utf-8" ?>
<local:CinemaPageControlBase
    x:Class="BiliCopilot.UI.Controls.Pgc.CinemaMainHeader"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:components="using:BiliCopilot.UI.ViewModels.Components"
    xmlns:converters="using:BiliCopilot.UI.Converters"
    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.Pgc"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <UserControl.Resources>
        <converters:PgcSectionTextConverter x:Key="SectionTextConverter" />
    </UserControl.Resources>

    <Grid
        Padding="16,0"
        VerticalAlignment="Center"
        ColumnSpacing="8">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <StackPanel
            HorizontalAlignment="Left"
            VerticalAlignment="Center"
            Orientation="Horizontal"
            Spacing="8">
            <TextBlock
                VerticalAlignment="Center"
                Style="{StaticResource BodyStrongTextBlockStyle}"
                Text="{x:Bind ViewModel.SelectedSection.SectionType, Converter={StaticResource SectionTextConverter}, Mode=OneWay}" />
            <TextBlock
                VerticalAlignment="Center"
                Foreground="{ThemeResource TextFillColorTertiaryBrush}"
                Style="{StaticResource CaptionTextBlockStyle}"
                Text="{ext:Locale Name=Index}" />
        </StackPanel>
        <Button
            Grid.Column="1"
            Padding="12,8"
            VerticalAlignment="Center"
            AutomationProperties.Name="{ext:Locale Name=MyFavoriteFilm}"
            Command="{x:Bind ViewModel.ShowMyFavoriteCinemaCommand}">
            <StackPanel Orientation="Horizontal" Spacing="8">
                <ic:SymbolIcon
                    VerticalAlignment="Center"
                    FontSize="14"
                    Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
                    Symbol="MoviesAndTv" />
                <TextBlock
                    VerticalAlignment="Center"
                    Text="{ext:Locale Name=MyFavoriteFilm}"
                    TextLineBounds="Tight" />
            </StackPanel>
        </Button>
        <Button
            Grid.Column="2"
            Padding="12,8"
            VerticalAlignment="Center"
            AutomationProperties.Name="{ext:Locale Name=Refresh}"
            Command="{x:Bind ViewModel.SelectedSection.RefreshCommand, Mode=OneWay}"
            ToolTipService.ToolTip="{ext:Locale Name=Refresh}">
            <ic:SymbolIcon
                FontSize="14"
                Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
                Symbol="ArrowSync" />
        </Button>
    </Grid>
</local:CinemaPageControlBase>
