<?php
$tabs = mb_get_block_field("component-tabs");

if ($tabs) { ?>
<section <?= inoby_block_attrs($attributes, ["class" => "component-tabs"]) ?>>
  <div class="container">
    <div class="row">
      <div class="col-12 tabs-wrap">
        <div class="tabs-filter">
          <?php
          $tab_filter_id = 0;
          foreach ($tabs as $tab) {
            echo '<a id="tab-index-' . $tab_filter_id . '" href="#0" class="';
            if ($tab_filter_id == 0) {
              echo "active ";
            }
            echo 'tab-filter">';
            echo $tab["headline"] ?? "";
            echo "</a>";
            $tab_filter_id++;
          }
          ?>
        </div>
        <div class="tabs-content">
          <?php
          $tab_content_id = 0;
          foreach ($tabs as $tab) {
            echo '<div id="tab-index-' . $tab_content_id . '" class="';
            if ($tab_content_id == 0) {
              echo "active ";
            }
            echo 'tab-content">';
            echo $tab["content"] ?? "";
            echo "</div>";
            $tab_content_id++;
          }
          ?>
        </div>
      </div>
    </div>
  </div>
</section>
<?php }
