@page "/weapon-list"
@using Domain.XML_Model
@attribute [StreamRendering(true)]

<div>
    <h3>Weapon</h3>
</div>
<div>
    @if (Weapons == null)
    {
        <p><em>Loading...</em></p>
    }
    else
    {
        <div class="container-fluid">
            <div class="row  border border-2">
                <div class="col">Nom</div>
                <div class="col">Genre</div>
                <div class="col">Type</div>
                <div class="col">Groupe</div>
                <div class="col">Portée</div>
                <div class="col">Modes</div>
                <div class="col">Dégâts</div>
                <div class="col">Type Dégâts</div>
                <div class="col">Pénétration</div>
                <div class="col">Autonomie</div>
                <div class="col">Rechargement</div>
                <div class="col">Attributs</div>
                <div class="col">Accessoires</div>
                <div class="col">Poids</div>
                <div class="col">Bonus BF</div>
                <div class="col">Prix</div>
                <div class="col">Disponibilité</div>
            </div>
            <div>
                @foreach (var weapon in Weapons)
                {
                    <div @onclick="() => weapon.ToggleDescription()">
                        <Weapon Arme="weapon.Arme" />
                        @if (weapon.ShowDetails)
                        {
                            <div class="description">
                                Description : @weapon.Arme.Description
                            </div>
                        }
                    </div>
                }
            </div>
        </div>
    }
</div>



@code {
    
}
