<?php

/*
 * This file is part of the VITICORE2 package.
 *
 * (c) CP Creation <web@cpcreation.fr>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CpCreation\VitiCore\Bridge\Symfony\Bundle\Form\Site;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;

final class ContactFormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder->add('lastname', TextType::class, [
            'label' => 'field.lastname',
            'translation_domain' => 'form',
            'attr' => [
                'autocomplete' => 'family-name',
            ],
        ])
            ->add('firstname', TextType::class, [
                'label' => 'field.firstname',
                'translation_domain' => 'form',
                'attr' => [
                    'autocomplete' => 'given-name',
                ],
            ])
            ->add('object', TextType::class, [
                'label' => 'field.subject',
                'translation_domain' => 'form',
                'attr' => [
                    'autocomplete' => 'off',
                ],
            ])
            ->add('email', EmailType::class, [
                'label' => 'field.email',
                'translation_domain' => 'form',
                'attr' => [
                    'autocomplete' => 'email',
                ],
            ])
            ->add('phone', TextType::class, [
                'label' => 'field.number',
                'translation_domain' => 'form',
                'attr' => [
                    'autocomplete' => 'tel',
                ],
            ])
            ->add('message', TextareaType::class, [
                'label' => 'field.message',
                'translation_domain' => 'form',
                'attr' => [
                    'autocomplete' => 'off',
                ],
            ])
            ;
    }
}
