<?php
/**
 * Template part for displaying the news header
 *
 * @package MarComm-AUX
 * @since 1.0.0
 */
use WP_AUX\Entities\PageTemplate\HeaderEntity;
use WP_AUX\Services\AuxFramework\ElementClassesService;
use WP_AUX\Services\PageTemplate\StoryHeaderService;

/* @var $header HeaderEntity */
$header = @$args['header'];

$backgroundElement = '';

$classes = ElementClassesService::buildClasses('news-page-header');
if ($header->isType('featured')) {
  $classes->addModifier('featured');
  $backgroundElement = '<div class="news-page-header__bg"></div>';
}
?>
<div class="<?php echo $classes; ?>">
  <?php echo $backgroundElement; ?>
  <div class="news-page-header__container">
    <?php
    StoryHeaderService::renderHeaderTitle($header);
    StoryHeaderService::renderHeaderByline($header);
    ?>
  </div>
</div>
