@page "/"
@using System.ComponentModel.DataAnnotations
@using System.Text
@using ModelsLib
@using ToolsPhotoShare
@inject EmailService mailService
@inject IJSRuntime JS
@inject ConfigAppServices _configDb
@rendermode InteractiveServer
@using Microsoft.EntityFrameworkCore;
@inject NavigationManager Navigation
<PageTitle>Accueil</PageTitle>

<main class="home-container">

    <!-- Hero -->
    <section class="hero-section text-center">
        <div class="badge">Photographe Amateur</div>
        <h1 class="hero-title">Hello,<br /><span class="italic">Moi c'est @DataPage.TitlePseudo</span></h1>
        <p class="hero-subtitle">
            @DataPage.SubTitle1
        </p>
        <p class="hero-subtitle">
            @DataPage.SubTitle2
        </p>
    </section>

    <section class="social-section text-center">
       
        <div class="social-buttons">
            <NavLink href="/ShootingDesire">
                <h2 class="social-title">Mes envies de shooting</h2>
            </NavLink>

        </div>
    </section>

    <!-- Social -->
    <section class="social-section text-center">
        <h2 class="social-title">Où me retrouver ?</h2>
        <p class="social-subtitle">Suivez mon travail et mes derniers shootings</p>

        <div class="social-buttons">
            <a href="@DataPage.InstaLink">

                <div class="qr-wrapper">
                    <img src="@DataPage.InstaQrCode" alt="QR Code Instagram" class="qr-image" />
                </div>
            </a>

        </div>
    </section>

</main>

<footer class="footer">
    <div class="footer-line"></div>
    <p>© 2026 @DataPage.Credentials — Droits réservés</p>
</footer>


@code {
    #region properties
    private EntityHome DataPage = new();
    #endregion

    /// <summary>
    /// Chargement de la page
    /// </summary>
    protected override async Task OnInitializedAsync()
    {

        if (!await _configDb.HasAnyParametersAsync())
        {
            await _configDb.FillConfigTableWithDataPerDefault();
        }

        DataPage = await _configDb.readParametersApplication();

    }

    
}
