<?php

namespace AutoAdmin\Bundle\Seo\Form;

use AutoAdmin\Bundle\Admin\Form\Type\Component\RichSelect;
use AutoAdmin\Bundle\Seo\Entity\Redirect;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;

class RedirectCodeType extends AbstractType
{
    public function getParent(): string
    {
        return RichSelect::class;
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        parent::configureOptions($resolver);
        $resolver->setDefaults([
            'placeholder' => false,
            'choices' => [
                'seo.redirect_type.label.temporary' => Redirect::REDIRECT_302,
                'seo.redirect_type.label.permanent' => Redirect::REDIRECT_301,
            ],
        ]);
    }
}
