<?php
/**
 * Template part for displaying content of archive
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package errigal
 * @since 1.0.0
 */

defined( 'ABSPATH' ) || exit;

use Errigal\Constant\Errigal_Template_Part as Template_Part;

if ( have_posts() ) {
	get_template_part(
		'template-parts/header/page-header',
		null,
		array(
			Template_Part::HEADING     => get_the_archive_title(),
			Template_Part::DESCRIPTION => get_the_archive_description(),
		)
	);
	get_template_part( 'template-parts/component/content/post-list' );
	get_template_part( 'template-parts/component/content/posts-pagination' );

	return;
}

get_template_part(
	'template-parts/component/content/no-entry-section',
	null,
	array(
		/**
		 * Renders no entry section content.
		 *
		 * @since 1.1.0
		 *
		 * @return void
		 */
		Template_Part::RENDER_CALLBACK => function () {
			get_template_part( 'template-parts/header/page-header-nothing-found' );
			get_template_part( 'template-parts/component/content/content-none' );
		},
	)
);
