<?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="MauiAppStock.Views.MouvementStockPage"
             Title="Mouvement de Stock">
    <ScrollView>
        <VerticalStackLayout Spacing="10" Padding="20">
            <Label Text="Mouvement de Stock" 
                   SemanticProperties.HeadingLevel="Level1"
                   FontSize="24"
                   HorizontalOptions="Center" />

            <Button Text="Voir l'historique"
                    Clicked="OnViewHistoryClicked"
                    HorizontalOptions="End" />

            <Picker x:Name="TypeMouvementPicker"
                    Title="Type de Mouvement">
                <Picker.Items>
                    <x:String>Entrée Stock</x:String>
                    <x:String>Sortie Réparation</x:String>
                </Picker.Items>
            </Picker>

            <Picker x:Name="PiecePicker"
                    Title="Sélectionner une pièce"
                    ItemDisplayBinding="{Binding Nom}"
                    SelectedIndexChanged="OnPieceSelected"/>

            <Label Text="Quantité:"
                   SemanticProperties.HeadingLevel="Level2"/>
            <Entry x:Name="QuantiteEntry"
                   Keyboard="Numeric"
                   Placeholder="Entrez la quantité"/>

            <Label Text="Commentaire:"
                   SemanticProperties.HeadingLevel="Level2"/>
            <Editor x:Name="CommentaireEditor"
                    Placeholder="Ajouter un commentaire"
                    HeightRequest="100"/>

            <Button x:Name="SaveButton"
                    Text="Enregistrer"
                    SemanticProperties.Hint="Enregistre le mouvement de stock"
                    Clicked="OnSaveClicked"
                    HorizontalOptions="Center" />

            <Button x:Name="CancelButton"
                    Text="Annuler"
                    SemanticProperties.Hint="Annule l'opération"
                    Clicked="OnCancelClicked"
                    HorizontalOptions="Center" />
        </VerticalStackLayout>
    </ScrollView>
</ContentPage> 