<?php declare(strict_types=1);

namespace App\Engine\Settings\Sections\Contact;

class GeneralContactsForm extends \Symfony\Component\Form\AbstractType
{

    public function __construct(
        private readonly \Symfony\Contracts\Translation\TranslatorInterface $translator,
    ) {
    }

    public function configureOptions(\Symfony\Component\OptionsResolver\OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            "data_class" => GeneralContacts::class,
            "attr" => ["class" => "row"],
        ]);
    }

    public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options): void
    {
        /** @var \App\Engine\Settings\Sections\Contact\GeneralContacts $data */
        $data = $builder->getData();
        $builder
            ->add("address", \Symfony\Component\Form\Extension\Core\Type\TextType::class, [
                "row_attr" => ["class" => "col-md-6 mb-3"],
                "label" => $this->translator->trans("admin.settings.sections.general-contacts.address"),
                "required" => true,
            ])
            ->add("country", \Symfony\Component\Form\Extension\Core\Type\TextType::class, [
                "row_attr" => ["class" => "col-md-6 mb-3"],
                "label" => $this->translator->trans("admin.settings.sections.general-contacts.country"),
                "required" => true,
            ])
            ->add("phone", \Symfony\Component\Form\Extension\Core\Type\TextType::class, [
                "row_attr" => ["class" => "col-md-6 mb-3"],
                "label" => $this->translator->trans("admin.settings.sections.general-contacts.phone"),
                "required" => true,
            ])
            ->add("mapLink", \Symfony\Component\Form\Extension\Core\Type\TextType::class, [
                "row_attr" => ["class" => "col-md-6 mb-3"],
                "label" => $this->translator->trans("admin.settings.sections.general-contacts.map-link"),
                "required" => true,
            ])
            ->add("socials_section_title", \Symfony\Component\Form\Extension\Core\Type\FormType::class, [
                "label" => $this->translator->trans("admin.settings.sections.general-contacts.socials.section-title"),
                "mapped" => false,
                "row_attr" => ["class" => "FormSectionTitle"],
                "help" => $this->translator->trans("admin.settings.sections.general-contacts.socials.section-title-help"),
            ])
            ->add("socialsFacebookLink", \Symfony\Component\Form\Extension\Core\Type\TextType::class, [
                "row_attr" => ["class" => "col-md-6 mb-3"],
                "label" => $this->translator->trans("admin.settings.sections.general-contacts.socials-facebook-link"),
                "required" => true,
            ])
            ->add("socialsInstagramLink", \Symfony\Component\Form\Extension\Core\Type\TextType::class, [
                "row_attr" => ["class" => "col-md-6 mb-3"],
                "label" => $this->translator->trans("admin.settings.sections.general-contacts.socials-instagram-link"),
                "required" => true,
            ])
            ->add("submit", \Symfony\Component\Form\Extension\Core\Type\SubmitType::class, [
                "label" => $this->translator->trans("admin.action.settings.send"),
            ]);
    }

}