<?php
declare(strict_types=1);

namespace WP_AUX\Entities\AuxCF\Fields\Section;

use AuxCF\Entities\Field\Enum\RepeaterFieldLayoutEnum;
use AuxCF\Entities\Field\RepeaterFieldEntity;
use AuxCF\Entities\Settings\Enum\OperatorEnum;

class SectionCtasFieldEntity extends RepeaterFieldEntity
{
  public static string $name = 'section_ctas';
  protected string $label = 'Buttons';
  protected string $instructions = 'Select link destination and link text for each CTA button.';
  protected RepeaterFieldLayoutEnum $layout = RepeaterFieldLayoutEnum::Row;
  protected int $min = 1;
  protected ?int $max = 2; // Only allow max of 2 CTAs in AUX section intros
  protected array $initFields = [
    SectionCtaLinkFieldEntity::class,
  ];

  protected array $initConditionalLogic = [
    [[ SectionCtasSwitchFieldEntity::class, OperatorEnum::EQUALS, '1' ]],
  ];
}
