<?php

use App\Http\Controllers\ProfileRedirectController;
use App\Livewire\Home\Article\Index as ArticleIndex;
use App\Livewire\Home\Article\Show as ArticleShow;
use App\Livewire\Home\Cart\Index as CartComponent;
use App\Livewire\Home\Faq as FaqComponent;
use App\Livewire\Home\Index as HomeComponent;
use App\Livewire\Home\Outlet as OutletComponent;
use App\Livewire\Home\Product\Index as ProductIndex;
use App\Livewire\Home\Product\Show as ProductShow;
use App\Livewire\Home\Voucher as VoucherComponent;
use Illuminate\Support\Facades\Route;

Route::get('/', HomeComponent::class)->name('homepage');

Route::get('/outlets', OutletComponent::class)->name('outlet');

Route::prefix('products')
    ->name('product.')
    ->group(function () {
        Route::get('/', ProductIndex::class)->name('index');
        Route::get('/{slug}', ProductShow::class)->name('show');
    });

Route::get('/vouchers', VoucherComponent::class)->name('voucher');

Route::prefix('articles')
    ->name('article.')
    ->group(function () {
        Route::get('/', ArticleIndex::class)->name('index');
        Route::get('/{article:slug}', ArticleShow::class)->name('show');
    });

Route::get('/faqs', FaqComponent::class)->name('faq');

Route::get('/cart', CartComponent::class)->name('cart');

Route::get('/profile/redirect', ProfileRedirectController::class)->name('profile.redirect');
