<?php
/**
 * Template component for displaying content featured in the front page banner items.
 *
 * Responsible for rendering the banner items showcased on the front page.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Yaatra
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

$yaatra_front_banner_image  = yaatra_get_customizer_option_value( 'yaatra_front_banner_image' );
$yaatra_banner_title        = yaatra_get_customizer_option_value( 'yaatra_banner_title' );
$yaatra_banner_content      = yaatra_get_customizer_option_value( 'yaatra_banner_content' );
$yaatra_banner_btn_text     = yaatra_get_customizer_option_value( 'yaatra_banner_btn_text' );
$yaatra_banner_btn_link     = yaatra_get_customizer_option_value( 'yaatra_banner_btn_link' );

if ( !empty( $yaatra_front_banner_image ) ) {
?>
    <div class="cv-banner-wrapper">
        <figure>
            <img src="<?php echo esc_url( $yaatra_front_banner_image ); ?>">
        </figure>
        <div class="banner-content-wrapper">
            <div class="banner-content">
                <h2 class="banner-title"><?php echo esc_html( $yaatra_banner_title ); ?></h2>
                <div class="banner-info"><?php echo wp_kses_post( $yaatra_banner_content ); ?></div>
                <div class="banner-btn"><a href="<?php echo esc_url( $yaatra_banner_btn_link ); ?>"><?php echo esc_html( $yaatra_banner_btn_text ); ?> <i class="fas fa-plane"></i></a> </div>
            </div>
        </div><!-- banner-content-wrapper -->
    </div><!-- .cv-banner-wrapper -->
<?php
}