<?php
declare(strict_types=1);

namespace WP_AUX\Entities\AuxCF\Fields\DescriptionList;

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

class DescriptionListItemCtasFieldEntity extends RepeaterFieldEntity
{
  public static string $name = 'desscription_list_item_cta';
  protected string $label = 'CTAs';
  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 DLs
  protected array $initFields = [
    DescriptionListItemCtaFieldEntity::class,
  ];

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