<?php

namespace App\Controller;

use App\Entity\Feature;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;

final class FeatureController extends AbstractController
{
    private EntityManagerInterface $entityManager;

    public function __construct(EntityManagerInterface $entityManager)
    {
        $this->entityManager = $entityManager;
    }

    #[Route('/admin/feature', name: 'admin_feature_index')]
    public function index(): Response
    {
        $features = $this->entityManager->getRepository(Feature::class)->findAll();
        return $this->render('feature/index.html.twig', [
            'features' => $features,
        ]);
    }
}
