<?php
/**
 * Template part for displaying the standard header with a factoid
 *
 * @package MarComm-AUX
 * @since 1.0.0
 */
use WP_AUX\Entities\AuxFramework\Partials\QuickFactEntity;
use WP_AUX\Entities\PageTemplate\HeaderEntity;

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

$factoid = $header->getFactoid();

if (!$factoid) {
  return;
}

$factoidEntity = QuickFactEntity::create($factoid['heading'], $factoid['text'])
  ->setSuperheader($factoid['superheader'])
  ->setSubheader($factoid['subheader'])
  ->setIcon($factoid['quick_fact'] ? "aux_bolt" : "aux_sparkles")
  ->setFootnote($factoid['footnote']);

echo $factoidEntity;
