<?php
global $reviewSectionPatternParams;

$sectionContent = '<!-- wp:group {"align":"full","style":{"spacing":{"margin":{"top":"0","bottom":"0"},"padding":{"top":"var:preset|spacing|70","bottom":"var:preset|spacing|70"},"blockGap":"var:preset|spacing|40"},"elements":{"link":{"color":{"text":"var:preset|color|base"}}}},"backgroundColor":"primary","textColor":"base","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull has-base-color has-primary-background-color has-text-color has-background has-link-color" style="margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--70);padding-bottom:var(--wp--preset--spacing--70)"><!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|30"}},"layout":{"type":"constrained"},"hasAnimation":true,"animationType":"fadeInLeft","animationDistance":50,"animationDuration":300,"animationDelay":0,"triggerPoint":30,"scrollBehavior":"playOnView"} -->
<div class="wp-block-group orphic-motion-animation" data-animation-type="fadeInLeft" data-animation-distance="50" data-animation-duration="300" data-animation-delay="0" data-animation-trigger="30" data-scroll-behavior="playOnView"><!-- wp:heading {"textAlign":"center"} -->
<h2 class="wp-block-heading has-text-align-center">' . $reviewSectionPatternParams['title'] . '</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center">' . $reviewSectionPatternParams['description'] . '</p>
<!-- /wp:paragraph -->';

if (is_countable($reviewSectionPatternParams['review_platforms'])) {
  $platformIconsBlockString = '';
  $count = 0;
  foreach ($reviewSectionPatternParams['review_platforms'] as $reviewPlatform) {
    $platformIconsBlockString .= '"icons_' . $count . '_icon":"' . $reviewPlatform['icon'] . '","_icons_' . $count . '_icon":"field_67b4e9e17b678","icons_' . $count . '_link":{"title":"","url":"' . $reviewPlatform['url'] . '","target":"_blank"},"_icons_' . $count . '_link":"field_67b4ea037b679",';
    $count++;
  }
  $sectionContent .= '<!-- wp:acf/icon-list {"name":"acf/icon-list","data":{' . $platformIconsBlockString . '"icons":' . $count . ',"_icons":"field_67b4e9aa7b677","icon_justify":"center","_icon_justify":"field_67b5069a6df14"},"mode":"preview"} /-->';
}

$sectionContent .= '</div>
<!-- /wp:group -->

<!-- wp:separator -->
<hr class="wp-block-separator has-alpha-channel-opacity"/>
<!-- /wp:separator -->

<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30","left":"var:preset|spacing|30","right":"var:preset|spacing|30"}},"elements":{"link":{"color":{"text":"var:preset|color|primary"}}},"border":{"radius":"8px"}},"backgroundColor":"neutral","textColor":"primary","layout":{"type":"constrained"},"hasAnimation":true,"animationType":"fadeInRight","animationDistance":50,"animationDuration":300,"animationDelay":0,"triggerPoint":30,"scrollBehavior":"playOnView"} -->
<div class="wp-block-group has-primary-color has-neutral-background-color has-text-color has-background has-link-color orphic-motion-animation" style="border-radius:8px;padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)" data-animation-type="fadeInRight" data-animation-distance="50" data-animation-duration="300" data-animation-delay="0" data-animation-trigger="30" data-scroll-behavior="playOnView"><!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">' . $reviewSectionPatternParams['contactTitle'] . '</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>' . $reviewSectionPatternParams['contactDescription'] . '</p>
<!-- /wp:paragraph -->

<!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a href="' . $reviewSectionPatternParams['contact_page_url'] . '" class="wp-block-button__link wp-element-button">Contact us</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div>
<!-- /wp:group --></div>
<!-- /wp:group -->';

return $sectionContent;
