<?php
$type = mb_get_block_field("text_type");
$content = mb_get_block_field("text_content");
$align = mb_get_block_field("text_align");
$color = mb_get_block_field("text_color");
$color_value = "color: " . $color . ";";
$max_width = mb_get_block_field("text_max_width");
$max_width_value = "max-width:" . $max_width . "px;";
$item_align = mb_get_block_field("text_align_item");

if ($type) { ?>
<section <?= inoby_block_attrs($attributes, ["class" => "text"]) ?>>
  <div class="container">
    <div class="row">
      <div class="col-12 text-wrap">
        <?php if ($type) {
          echo "<" . $type . ' style="' . $align . "";
          if ($color) {
            echo $color_value;
          }
          if ($max_width) {
            echo $max_width_value;
          }
          if ($item_align) {
            echo $item_align;
          }
          echo '">';
          do_action('before_text_component_content');
          echo $content . "</" . $type . ">";
        } ?>
      </div>
    </div>
  </div>
</section>
<?php }