<?php

Route::livewire('/', 'pages::index')->name('home');
Route::livewire('/pages/{page:slug}', 'pages::page')->name('pages');

Route::middleware('guest')->group(function () {
    Route::livewire('/login', 'pages::auth.login')->name('login');
    Route::livewire('/register', 'pages::auth.register');
    Route::livewire('/forgot-password', 'pages::auth.forgot-password');
    Route::livewire('/reset-password/{token}', 'pages::auth.reset-password')->name('password.reset');
});

// Routes pour les utilisateurs authentifiés
Route::middleware('auth')->group(function () {
    Route::prefix('account')->group(function () {
        Route::livewire('/profile', 'pages::account.profile')->name('profile');
        Route::livewire('/addresses', 'pages::account.addresses.index')->name('addresses');
        Route::livewire('/addresses/create', 'pages::account.addresses.create')->name('addresses.create');
        Route::livewire('/addresses/{address}/edit', 'pages::account.addresses.edit')->name('addresses.edit');
    });
});
