<?php
declare(strict_types=1);

namespace WP_AUX\Entities\AuxCF\Fields\Callout;

use AuxCF\Entities\Field\Enum\RepeaterFieldLayoutEnum;
use AuxCF\Entities\Field\RepeaterFieldEntity;
use AuxCF\Entities\Settings\Enum\OperatorEnum;
use WP_AUX\Enum\CtaTypes\AllCtaTypesEnum;

class CalloutCtasFieldEntity extends RepeaterFieldEntity
{
  public static string $name = 'callout_ctas';
  protected string $label = 'CTAs';
  protected string $instructions = 'Select link destination and link text for the CTAs.';
  protected RepeaterFieldLayoutEnum $layout = RepeaterFieldLayoutEnum::Row;
  protected ?int $max = 2;
  protected int $min = 1;

  protected array $initFields = [
    CalloutLinkFieldEntity::class,
  ];

  protected array $initConditionalLogic = [
    [
      [ CalloutCtaTypeFieldEntity::class, OperatorEnum::EQUALS, AllCtaTypesEnum::Links],
    ],
    [
      [ CalloutCtaTypeFieldEntity::class, OperatorEnum::EQUALS, AllCtaTypesEnum::Buttons],
    ]
  ];
}
