<?php
/**
 * The template to display nothing found.
 *
 * This template can be overridden by copying it to
 * your-child-theme/views/nothing-found.php.
 *
 * @package MadeByAura\Prime
 * @author  MadeByAura.com
 *
 * @param array $args
 */

namespace MadeByAura\Prime;

use MadeByAura\Prime\Helpers\Markup;

defined( 'ABSPATH' ) || die();

// Set variables.
$type        = 'general';
$title       = __( 'Nothing found', 'aura-prime' );
$description = '';

if ( is_404() ) {
	$type        = '404';
	$title       = __( 'Page Not Found', 'aura-prime' );
	$description = __( 'The page you requested could not be found.', 'aura-prime' );
} elseif ( is_search() ) {
	$type        = 'search';
	$description = sprintf(
		// Translators: 1: Search query.
		__( 'No search results were found for %1s. Please try another keyword.', 'aura-prime' ),
		'"<em>' . get_search_query() . '</em>"'
	);
}

// Set CSS classes.
$classes[] = 'aura-nothing-found';
$classes[] = 'aura-nothing-found--' . $type;
?>

<div class="<?php Markup::echo_classes( $classes ); ?>">
	<?php if ( $title ) : ?>
		<h2 class="aura-nothing-found__title"><?php echo esc_html( $title ); ?></h2>
	<?php endif; ?>

	<?php if ( $description ) : ?>
		<div class="aura-nothing-found__description">
			<?php echo wp_kses( $description, [ 'em' => [] ] ); ?>
		</div>
	<?php endif; ?>
</div>
