<?php

declare(strict_types=1);

/*
 * This file is part of the Ferienpass package.
 *
 * (c) Richard Henkenjohann <richard@ferienpass.online>
 *
 * For more information visit the project website <https://ferienpass.online>
 * or the documentation under <https://docs.ferienpass.online>.
 */

namespace Ferienpass\AdminBundle\Controller;

use Ferienpass\AdminBundle\Components\Notification;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\MapQueryString;
use Symfony\Component\Routing\Attribute\Route;

class FlashMessageController extends AbstractController
{
    #[Route('/flash-message', name: 'admin_flash_message', methods: ['GET'])]
    public function __invoke(#[MapQueryString] Notification $notification): Response
    {
        return $this->render('@FerienpassAdmin/flash_message.stream.html.twig', [
            'props' => get_object_vars($notification),
        ]);
    }
}
