<?php
$press_reviews_datas = get_field('press_reviews_datas', 'option');

?>

<section <?php echo get_block_wrapper_attributes(["class" => "homegrade-blocks-press-reviews"]); ?>>
	<?php echo $content; ?>


	<ul class="homegrade-blocks-press-reviews__article-grid">
		<div class="table_head" aria-hidden="true">
			<p><?php echo __("Titre", "homegrade-blocks") ?></p>
			<p><?php echo __("Journal", "homegrade-blocks") ?></p>
			<p><?php echo __("Date", "homegrade-blocks") ?></p>
		</div>
		<?php foreach ($press_reviews_datas as $press_review) : ?>
			<li class="homegrade-blocks-press-reviews__press-article">
				<div class="homegrade-blocks-press-reviews__review-icon">
					<img src="<?php echo plugin_dir_url(__DIR__) . "src/img/homegrade_journal.svg" ?>" alt="">
				</div>
				<a class="homegrade-blocks-press-reviews__article-title-link" href="<?php echo  $press_review['article_url'] ?>" target="_blank">
					<?php echo  $press_review['article_title'] ?>
				</a>
				<p class="homegrade-blocks-press-reviews__newspaper-source-name"><?php echo $press_review['newspaper_source'] ?></p>
				<p class="homegrade-blocks-press-reviews__publication-date"><?php echo $press_review['publication_date'] ?></p>
				<a class="homegrade-blocks-press-reviews__article-download cta cta--secondary cta--button" href="<?php echo $press_review['article_url'] ?> "><?php echo __("Voir l'article", "homegrade-blocks") ?></a>
			</li>

		<?php endforeach; ?>

	</ul>


</section>