<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Admin\AdminController;
use Inertia\Inertia;

Route::get('/', function () {
    return Inertia::render('Public/Home');
})->name('home');

Route::get('/book-appointment', function () {
    return Inertia::render('Public/BookAppointment');
})->name('book-appointment');

Route::prefix('admin')->name('admin.')->group(function () {
    Route::get('/login', [AdminController::class, 'login'])
        ->middleware('guest')
        ->name('login');

    Route::middleware(['auth', 'admin'])->group(function () {
        Route::get('/', fn () => to_route('admin.dashboard'));

        Route::get('/dashboard', [AdminController::class, 'dashboard'])
            ->name('dashboard');

        Route::get('/appointments', [AdminController::class, 'appointments'])
            ->name('appointments');

        Route::get('/calendar', [AdminController::class, 'calendar'])
            ->name('calendar');

        Route::get('/availability', [AdminController::class, 'availability'])
            ->name('availability');

        Route::get('/clients', [AdminController::class, 'clients'])
            ->name('clients');

        Route::get('/services', [AdminController::class, 'services'])
            ->name('services');

        Route::get('/tax-insights', [AdminController::class, 'insights'])
            ->name('insights');

        Route::get('/settings', [AdminController::class, 'settings'])
            ->name('settings');
    });
});