<?php
$wrapper_attributes = get_block_wrapper_attributes(array('class' => 'highlight-timeline'));

$years = array();
if (isset($block) && is_object($block) && ! empty($block->inner_blocks)) {
	foreach ($block->inner_blocks as $inner_block) {
		if (isset($inner_block->name) && $inner_block->name === 'carhop-blocks/highlight-timeline-step') {
			$y = isset($inner_block->attributes['year']) ? $inner_block->attributes['year'] : null;
			if ($y !== null && $y !== '') {
				$years[] = $y;
			}
		}
	}
}
?>

<section <?php echo $wrapper_attributes; ?>>

	<div class="highlight-timeline__innerblocks swiper highlight-timeline-swiper" id="<?php echo esc_attr($years[0]); ?>">
		<div class="swiper-wrapper">
			<?php echo $content; ?>
		</div>
	</div>

	<div class="swiper-pagination"></div>

	<div class="swiper-controls">
		<div class="swiper-button-prev"></div>
		<div class="swiper-button-next"></div>
	</div>


</section>