<?xml version="1.0" encoding="utf-8" ?>
<local:AnimeTimelineControlBase
    x:Class="BiliCopilot.UI.Controls.Pgc.AnimeTimelineSideControl"
    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:components="using:BiliCopilot.UI.Controls.Components"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ext="using:BiliCopilot.UI.Extensions"
    xmlns:items="using:BiliCopilot.UI.ViewModels.Items"
    xmlns:local="using:BiliCopilot.UI.Controls.Pgc"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:base="using:Richasy.WinUIKernel.Share.Base"
    VerticalAlignment="Stretch"
    mc:Ignorable="d">

    <Grid>
        <ItemsView
            x:Name="TimelineView"
            Padding="12"
            ItemsSource="{x:Bind ViewModel.Timelines, Mode=OneWay}"
            SelectionMode="Single">
            <ItemsView.ItemTemplate>
                <DataTemplate x:DataType="items:TimelineItemViewModel">
                    <ItemContainer Background="{ThemeResource CardBackgroundFillColorDefaultBrush}" Style="{StaticResource AppItemContainerStyle}">
                        <components:TimelineControl ViewModel="{x:Bind}" />
                    </ItemContainer>
                </DataTemplate>
            </ItemsView.ItemTemplate>
            <ItemsView.Layout>
                <StackLayout Spacing="8" />
            </ItemsView.Layout>
        </ItemsView>

        <base:EmptyHolder
            Description="{ext:Locale Name=RequestPgcTimeLineFailed}"
            Emoji="&#x1F6F8;"
            Visibility="{x:Bind ViewModel.IsEmpty, Mode=OneWay}" />

        <components:SideBottomLoadingWidget Text="{ext:Locale Name=LoadingAndWait}" Visibility="{x:Bind ViewModel.IsTimelineLoading, Mode=OneWay}" />

        <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:AnimeTimelineControlBase>
