<?php

namespace App\Twig\Components;

use App\Entity\Manga;
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
use Symfony\UX\LiveComponent\Attribute\LiveProp;
use Symfony\UX\LiveComponent\DefaultActionTrait;

#[AsLiveComponent]
class AddMangaModalComponent
{
    use DefaultActionTrait;

    #[LiveProp(writable: true)]
    public ?Manga $manga;

    public function open(Manga $manga): void
    {
        $this->manga = $manga;
    }

    public function close(): void
    {
        $this->manga = null;
    }
}
