<?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"
             x:Class="GMCabsDriverAssistantSolution.Views.AcceptBookingPage"
             Title="{Binding Title}">
    <ContentPage.Content>
        <StackLayout BackgroundColor="#DCDCDC">

            <StackLayout
                IsVisible="{Binding IsProcessing}"
                VerticalOptions="CenterAndExpand">
                <Label Text="Processing"
                       TextColor="Black"
                       FontSize="25"
                       HorizontalTextAlignment="Center"
                       HorizontalOptions="CenterAndExpand" />
                <Label Text="Please Wait"
                       TextColor="Black"
                       FontSize="24"
                       Margin="0,15,0,20"
                       HorizontalTextAlignment="Center"
                       HorizontalOptions="CenterAndExpand" />
                <ActivityIndicator IsRunning="true" />
            </StackLayout>


            <StackLayout 
                    VerticalOptions="Center"
                    IsVisible="{Binding IsBookingConfirmed}">
                <Label 
                    Text="Booking Awarded"
                    TextColor="Black"
                    FontSize="26"
                    Margin="0,40,0,0"
                    HorizontalTextAlignment="Center"
                    HorizontalOptions="CenterAndExpand" />
                <Image
                    Source="righttic.png"
                    HeightRequest="100"/>
            </StackLayout>

            <StackLayout 
                    VerticalOptions="Center"
                    IsVisible="{Binding IsBookingConfirmedAndOnDemand}">
                <Label 
                    Text="Head to"
                    TextColor="Black"
                    FontSize="20"
                    HorizontalTextAlignment="Center"
                    HorizontalOptions="CenterAndExpand" />
                <Label 
                    Text="Please confirm on terminal ASAP to keep this booking"
                    TextColor="Black"
                    Margin="40,0,40,0"
                    FontSize="26"
                    HorizontalTextAlignment="Center"
                    HorizontalOptions="CenterAndExpand"/>
                <Label 
                    Text="{Binding TimerSeconds}"
                    TextColor="Black"
                    FontAttributes="Bold"
                    Margin="0,20,0,0"
                    FontSize="30"
                    HorizontalOptions="CenterAndExpand"/>
                <Label 
                    Text="Before Automatic Cancellation"
                    TextColor="Black"
                    FontSize="20"
                     Margin="0,20,0,0"
                    HorizontalOptions="CenterAndExpand" />
            </StackLayout>
            <StackLayout VerticalOptions="EndAndExpand"
                    IsVisible="{Binding IsBookingConfirmed}">
                <Button
                        Margin="40,0,40,15"
                        Text="OK"
                        Clicked="OnAcceptOkClicked"
                        FontSize="20" 
                    />
            </StackLayout>
            <StackLayout 
                    IsVisible="{Binding IsBookingUnavailable}">
                <Label 
                    Text="{Binding ErrorMessage}"
                    TextColor="Black"
                    FontAttributes="Bold"
                    FontSize="24"
                    Margin="40,100,40,0"
                    HorizontalTextAlignment="Center"
                    HorizontalOptions="CenterAndExpand" />
                <Label 
                    Text="This booking is no longer available"
                    HorizontalTextAlignment="Center"
                    TextColor="Black"
                    Margin="40,60,40,0"
                    FontSize="25"/>
                <Button
                    VerticalOptions="EndAndExpand"
                    Margin="40,140,40,0"
                    Text="OK"
                    FontSize="20"
                    Clicked="OnUnavailableOkClicked"/>
            </StackLayout>

        </StackLayout>

    </ContentPage.Content>
</ContentPage>