<?php

namespace AutoAdmin\Bundle\Admin\Form;

use AutoAdmin\Bundle\Admin\Model\AdministratorInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class ResettingType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('password', RepeatedType::class, [
                'type' => PasswordType::class,
                'first_options' => [
                    'label' => 'Mot de passe*',
                    "attr" => [
                        "placeholder" => "Mot de passe*"
                    ]
                ],
                'second_options' => [
                    'label' => 'Confirmation*',
                    "attr" => [
                        "placeholder" => "Confirmation*"
                    ]
                ]
            ]);
    }

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