<?php

declare(strict_types=1);

/*
 * This file is part of the Ferienpass package.
 *
 * (c) Richard Henkenjohann <richard@ferienpass.online>
 *
 * For more information visit the project website <https://ferienpass.online>
 * or the documentation under <https://docs.ferienpass.online>.
 */

namespace Ferienpass\AdminBundle\Form\Offer;

use Ferienpass\AdminBundle\Form\AsOfferFormType;
use Ferienpass\AdminBundle\Form\CompoundType\OfferAttachmentType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\UX\LiveComponent\Form\Type\LiveCollectionType;

#[AsOfferFormType]
class Attachments extends AbstractType
{
    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'section' => 'attachments',
            'entry_type' => OfferAttachmentType::class,
            'label' => false,
            'allow_add' => false,
            'allow_delete' => true,
            'by_reference' => true,
        ]);
    }

    public function getParent(): string
    {
        return LiveCollectionType::class;
    }
}
