<?php

namespace App\Http\Controllers;

use App\Services\DummyDataService;
use Illuminate\Http\Request;

class KatalogController extends Controller
{
    public function index(Request $request)
    {
        $filters = $request->only(['search', 'kategori', 'tahun', 'penulis']);

        $semuaBuku = DummyDataService::getKatalogBuku($filters);
        $filterOptions = DummyDataService::getFilterOptions();

        return view('katalog.index', [
            'semuaBuku' => $semuaBuku,
            'filterOptions' => $filterOptions,
            'input' => $filters,
            'pageTitle' => 'Katalog Buku',
            'mode' => 'umum',
        ]);
    }
}
