<div class="banner mat-elevation-z2">
    <div class="banner-content d-flex text-bg-accent bg-opacity-50">
        <img [src]="user.image" class="user-img me-3" [alt]="user.username" />
        <div class="flex-spacer">
            <h3 class="mb-0">{{bannerTitle}}</h3>
            <span class="fs-6">{{user.firstname}} {{user.lastname}}</span>
        </div>
        <div class="align-self-center text-end">
            <button mat-raised-button color="megna" [routerLink]="['/profile', user.username]">
                <mat-icon aria-label="Voir le compte" fontIcon="person"></mat-icon> Mon compte
            </button>
            <button mat-raised-button color="warn" routerLink="/settings" class="ms-2">
                <mat-icon aria-label="Modifier le compte" fontIcon="settings"></mat-icon> Paramètres
            </button>
        </div>
    </div>
</div>
<div class="credentials-page">
    <h1>{{title}}</h1>
    <mat-divider></mat-divider>
    <app-list-errors [errors]="errors"></app-list-errors>
    <div class="container page mt-4">
        <div class="row">
            <div class="col-lg-8 offset-lg-2 col-xl-6 offset-xl-3 col-xs-12">
                <form class="row row-cols-lg-auto" [formGroup]="credentialsForm" (ngSubmit)="submitForm()">
                    <fieldset [disabled]="isSubmitting" class="w-100">
                        <legend [hidden]="true">Mise à jour du mot de passe</legend>
                        <div class="col-12">
                            <mat-form-field appearance="fill" class="w-100">
                                <mat-label>Mot de passe</mat-label>
                                <input matInput type="password" placeholder="Nouveau mot de passe" formControlName="password">
                            </mat-form-field>
                        </div>
                        <div class="col-12">
                            <mat-form-field appearance="fill" class="w-100">
                                <mat-label>Confirmation du mot de passe</mat-label>
                                <input matInput type="password" placeholder="Confirmez votre nouveau mot de passe" formControlName="confirmPassword">
                            </mat-form-field>
                        </div>
                        <div class="col-12">
                            <button mat-raised-button color="primary" [disabled]="!credentialsForm.valid" type="submit" class="float-sm-end">{{ btnUpdateTitle }}</button>
                        </div>
                    </fieldset>
                </form>
            </div>
        </div>
    </div>
</div>
