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

use EstatebudConnect\Utilities\Helper;

$shortcode_id = $shortcode_id ?? '';
$is_map_active = (bool) ($is_map_active ?? false);
$map_position = $map_position ?? 'top';

$side_map_container_class = $is_map_active && in_array($map_position, ['left', 'right'], true)
    ? ' estatebud-listings-container-map-side'
    : '';

$container_classes = trim(
    'estatebud-listings-container estatebud-listings-container-loading' . $side_map_container_class,
);
?>

<div class="<?php echo esc_attr($container_classes); ?>"
    id="<?php echo esc_attr(sprintf('estatebud-mobile-listings-container-%s', $shortcode_id)); ?>">
    <div class="estatebud-mobile-listings-handle" id="<?php echo esc_attr(sprintf('estatebud-mobile-listings-handle-%s', $shortcode_id)); ?>">
        <span class="estatebud-mobile-listings-handle-bar"></span>
    </div>
    <div class="estatebud-mobile-listings-inside-handle" id="<?php echo esc_attr(sprintf('estatebud-mobile-listings-inside-handle-%s', $shortcode_id)); ?>">
        <span class="estatebud-mobile-listings-handle-bar"></span>
    </div>
    <div class="estatebud-mobile-listings-scroll">
        <?php
        Helper::render_markup_from_views('Public/Listings/components/loading.php', [
            'settings_data' => $settings_data ?? [],
        ]);
        ?>
    </div>
</div>

