<?php

namespace App\Livewire;

use Livewire\Component;
use App\Models\Tag;
use App\Models\Category;

class CategoryFilter extends Component
{
    public ?Tag $filter = null;

    public function setFilter(int $filter) {
        $this->filter = Tag::find($filter);
    }

    public function render()
    {
        return view('livewire.category-filter', [
            'tags' => Tag::all(),
            'categories' => Category::all(),
        ]);
    }
}
