<?php

namespace App\Livewire\Image;

use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Collection;
use Livewire\Component;
use Livewire\Attributes\On;

class Grid extends Component
{
    public Collection $images;

    #[On('image.rotate')]
    public function rotate(int id, string $direction) : void {
        $degree = match ($direction) {
            'ccw' => -90,
            'cw' => 90,
            default => 0,
        }
    }

    public function mount(Collection $images): void {
        $this->images = $images;
    }

    public function render(): View|Factory
    {
        return view('livewire.image.grid');
    }
}
