<?php

namespace KupShop\ComponentsBundle\Twig\Components\ShoppingList\Types;

use KupShop\ComponentsBundle\Twig\Components\ShoppingList\Utils\Entity;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class FormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder->add('newListName', TextType::class, [
            'required' => true,
            'attr' => [
                'placeholder' => 'form.placeholder.newListName',
            ],
            'label' => false,
        ]);
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'data_class' => Entity::class,
            'translation_domain' => 'users',
        ]);
    }
}
