<?xml version="1.0" encoding="utf-8" ?>
<local:AnimePageControlBase
    x:Class="BiliCopilot.UI.Controls.Pgc.AnimeSideHeader"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:animations="using:CommunityToolkit.WinUI.Animations"
    xmlns:community="using:CommunityToolkit.WinUI.Controls"
    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:items="using:BiliCopilot.UI.ViewModels.Items"
    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" />
        <converters:PgcSectionIconConverter x:Key="SectionIconConverter" />
        <DataTemplate x:Name="SectionTemplate" x:DataType="items:IPgcSectionDetailViewModel">
            <SelectorBarItem Tag="{x:Bind}" ToolTipService.ToolTip="{x:Bind SectionType, Converter={StaticResource SectionTextConverter}}">
                <SelectorBarItem.Icon>
                    <ic:SymbolIcon FontSize="16" Symbol="{x:Bind SectionType, Converter={StaticResource SectionIconConverter}}" />
                </SelectorBarItem.Icon>
            </SelectorBarItem>
        </DataTemplate>
    </UserControl.Resources>

    <Grid Padding="16,0" ColumnSpacing="8">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <TextBlock
            VerticalAlignment="Center"
            Style="{StaticResource BodyStrongTextBlockStyle}"
            Text="{x:Bind ViewModel.SelectedSection.SectionType, Mode=OneWay, Converter={StaticResource SectionTextConverter}}" />
        <SelectorBar
            x:Name="SectionSelector"
            Grid.Column="1"
            VerticalAlignment="Center" />
        <animations:Implicit.ShowAnimations>
            <animations:TranslationAnimation
                From="-20,0"
                To="0,0"
                Duration="0:0:0.24" />
            <animations:OpacityAnimation
                From="0.0"
                To="1.0"
                Duration="0:0:0.2" />
        </animations:Implicit.ShowAnimations>
        <animations:Implicit.HideAnimations>
            <animations:TranslationAnimation
                From="0,0"
                To="-20,0"
                Duration="0:0:0.24" />
            <animations:OpacityAnimation
                From="1.0"
                To="0.0"
                Duration="0:0:0.2" />
        </animations:Implicit.HideAnimations>
    </Grid>
</local:AnimePageControlBase>
