<?php
declare(strict_types=1);

namespace WP_AUX\Entities\AuxFramework\Partials;

class CtaButtonGroupEntity extends ButtonGroupEntity
{
  public static ?string $mode = 'cta';

  public function addButton(array $link): ButtonEntity
  {
    if (empty($this->buttons)) {
      $button = CtaPrimaryButtonEntity::create($link, $this);
    } else {
      $button = CtaSecondaryButtonEntity::create($link, $this);
    }

    $this->buttons[] = $button;

    return $button;
  }
}
