<?php
if (!defined('WPINC')) {
    die();
}

use EstatebudConnect\Utilities\Helper;

$listings_content_class = 'estatebud-listings-content';
if ($is_map_active) {
    $listings_content_class .= sprintf(' estatebud-listings-content-map-%s', $map_position);
}
?>

<div class="<?php echo esc_attr($listings_content_class); ?>">
    <?php if ($has_map): ?>
        <div class="estatebud-map-wrapper<?php echo $is_map_active ? ' estatebud-map-wrapper-is-active estatebud-map-wrapper-map-side' : ''; ?>">
            <div id="<?php echo esc_attr(sprintf('estatebud-listings-map-%s', $shortcode_id)); ?>" class="estatebud-listings-map">
                <div class="estatebud-map-loader"></div>
            </div>
        </div>
    <?php endif; ?>

    <?php
    Helper::render_markup_from_views('Public/Listings/partials/listings-container.php', [
        'shortcode_id' => $shortcode_id,
        'is_map_active' => $is_map_active,
        'map_position' => $map_position,
        'settings_data' => $settings_data,
    ]);
    ?>
</div>
