<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:view="clr-namespace:LivreLand.View"
             xmlns:contentView="clr-namespace:LivreLand.View.ContentViews"
             xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
             x:Class="LivreLand.View.BibliothequeView"
             Title="BibliothequeView">
    
    <ContentPage.Behaviors>
        <toolkit:StatusBarBehavior>
            <toolkit:StatusBarBehavior.StatusBarColor>
                <AppThemeBinding Light="{StaticResource Black}"/>
            </toolkit:StatusBarBehavior.StatusBarColor>
        </toolkit:StatusBarBehavior>
    </ContentPage.Behaviors>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="10"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <view:HeaderHome Grid.Row="0"
                         ButtonTappedCommand="{Binding BibliothequeVM.Navigator.PopupHomePlusNavigationCommand}"/>
        <ScrollView Grid.Row="2">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="10"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

                <Label Text="Mes Livres"
                       Margin="10,0,0,0"
                       Style="{StaticResource HomeTitle}"
                       Grid.Row="0"/>

                <VerticalStackLayout Grid.Row="2">
                    <VerticalStackLayout.BackgroundColor>
                        <AppThemeBinding Light="{StaticResource LightGray}" Dark="{StaticResource Black}" />
                    </VerticalStackLayout.BackgroundColor>

                    <contentView:SeparatorEntireView/>

                    <!--Tous-->
                    <contentView:HomeButtonView ButtonTitle="Tous"
                                                ButtonIcon="tray_2_fill.png"
                                                ButtonNumber="{Binding BibliothequeVM.Manager.NbBooks}"
                                                ButtonRedIconVisible="False"
                                                ButtonBlackIconVisible="True"
                                                ButtonTappedCommand="{Binding BibliothequeVM.AllBooksNavigateCommand}"/>

                    <contentView:SeparatorCutStartView/>

                    <!--En prêt-->
                    <contentView:HomeButtonView ButtonTitle="En prêt"
                                                ButtonIcon="person_badge_clock_fill.png"
                                                ButtonNumber="1"
                                                ButtonRedIconVisible="False"
                                                ButtonBlackIconVisible="True"
                                                ButtonTappedCommand="{Binding BibliothequeVM.AllLoansBorrowingsNavigateCommand}"/>

                    <contentView:SeparatorCutStartView/>

                    <!--À lire plus tard-->
                    <contentView:HomeButtonView ButtonTitle="À lire plus tard"
                                                ButtonIcon="arrow_forward.png"
                                                ButtonRedIconVisible="False"
                                                ButtonBlackIconVisible="True"
                                                ButtonTappedCommand="{Binding BibliothequeVM.AllToReadBooksNavigateCommand}"/>

                    <contentView:SeparatorCutStartView/>

                    <!--Statut de lecture-->
                    <contentView:HomeButtonView ButtonTitle="Statut de lecture"
                                                ButtonIcon="eyeglasses.png"
                                                ButtonRedIconVisible="False"
                                                ButtonBlackIconVisible="True"
                                                ButtonTappedCommand="{Binding BibliothequeVM.AllStatusBooksNavigateCommand}"/>

                    <contentView:SeparatorCutStartView/>

                    <!--Favoris-->
                    <contentView:HomeButtonView ButtonTitle="Favoris"
                                                ButtonIcon="heart_fill.png"
                                                ButtonRedIconVisible="False"
                                                ButtonBlackIconVisible="True"
                                                ButtonTappedCommand="{Binding BibliothequeVM.AllFavorisBooksNavigateCommand}"/>

                    <contentView:SeparatorEntireView/>
                </VerticalStackLayout>

                <Label Text="Filtres"
                       Margin="10,0,0,0"
                       Style="{StaticResource HeaderTitle}"
                       Grid.Row="4"/>

                <VerticalStackLayout Grid.Row="6">
                    <VerticalStackLayout.BackgroundColor>
                        <AppThemeBinding Light="{StaticResource LightGray}" Dark="{StaticResource Black}" />
                    </VerticalStackLayout.BackgroundColor>

                    <contentView:SeparatorEntireView/>

                    <!--Auteur-->
                    <contentView:HomeButtonView ButtonTitle="Auteur"
                                                ButtonIcon="person_fill.png"
                                                ButtonRedIconVisible="False"
                                                ButtonBlackIconVisible="True"
                                                ButtonTappedCommand="{Binding BibliothequeVM.AllAuthorsNavigateCommand}"/>

                    <contentView:SeparatorCutStartView/>

                    <!--Date de publication-->
                    <contentView:HomeButtonView ButtonTitle="Date de publication"
                                                ButtonIcon="calendar.png"
                                                ButtonRedIconVisible="False"
                                                ButtonBlackIconVisible="True"
                                                ButtonTappedCommand="{Binding BibliothequeVM.AllDatesNavigateCommand}"/>

                    <contentView:SeparatorCutStartView/>

                    <!--Note-->
                    <contentView:HomeButtonView ButtonTitle="Note"
                                                ButtonIcon="sparkles.png"
                                                ButtonRedIconVisible="False"
                                                ButtonBlackIconVisible="True"
                                                ButtonTappedCommand="{Binding BibliothequeVM.AllRatingsNavigateCommand}"/>

                    <contentView:SeparatorEntireView/>
                </VerticalStackLayout>

            </Grid>
        </ScrollView>
    </Grid>
    
</ContentPage>