@page "/transfer"
@using TIAMSharedUI.Shared
@inject NavigationManager navManager
<PageTitle>Transfer</PageTitle>

<div class="text-center m-5">
    <h1>Transfer</h1>
    <h2 style="font-size:small">Swipe to select your destination!</h2>
</div>


    <SliderItemSelector @ref="slider" OwlId="owlSelector1" OnSliderChanged=@DisplaySlideData></SliderItemSelector>

    <SliderItemSelector @ref="slider2" OwlId="owlSelector2" OnSliderChanged=@DisplaySlideData></SliderItemSelector>

<div class="wrapper">    
   
    <form class="p-3 mt-2">
        <div class="form-field d-flex align-items-center">
            <input value=@message2 type="text" name="DestinationAddress" id="destinationAddress" placeholder="Destination" disabled>
        </div>
        
        <div class="form-field d-flex align-items-center">
            <input type="tel" name="phone" id="phone" placeholder="Phone number">
        </div>
        <div class="form-field d-flex align-items-center">            
            <input type="text" name="address" id="address" placeholder="Pick up address">
        </div>
        <div class="form-field d-flex align-items-center">
            <input type="date" name="date" id="date" placeholder="Date of transfer">
        </div>
        <div class="form-field d-flex align-items-center">
            <input type="time" name="time" id="time" placeholder="Time of transfer">
        </div>
        <div class="form-field d-flex align-items-center">
            <input type="number" name="time" id="passengers" placeholder="Number of passangers">
        </div>

        <a class="btn btn-primary mt-3" @onclick="next">Next</a>
    </form>    
</div>




@code {
    SliderItemSelector slider;
    SliderItemSelector slider2;
    public string message;   
    public string message2;   
    public List<string> destinations = new List<string>() {"Liszt Ferenc Airport", "Buda Castle", "Chain Bridge"};

    void DisplaySlideData()
    {
        if(slider.SliderElementId != 0)
        {
            message2 = destinations[slider.SliderElementId-1];    
        }
        
    }

    /*protected override void OnAfterRender(bool isFirst)
        {
        message = " Target destination is " + slider.SliderElementId.ToString();
    }*/    

     public void next() => navManager.NavigateTo("/transfer2");
   

}

