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

/**
 * @var $data
 */

use DEVELUXSCT\HTMLGenerators\SVG_Generator;

$post = $data['post'] ?? null;
$develuxsct_renderer = $data['renderer'] ?? null;
if (!$post || !$develuxsct_renderer) {
    return;
}
$develuxsct_allowed_html = $develuxsct_renderer::get_allowed_html();
$develuxsct_sale_start = get_post_meta($post->ID, '_sale_price_dates_from', true) ?? '';
$develuxsct_sale_end = get_post_meta($post->ID, '_sale_price_dates_to', true) ?? '';
$develuxsct_text_editor_svg = SVG_Generator::generate_text_editor_icons();
$develuxsct_button_svg = SVG_Generator::generate_button_icons();
?>
<div id="tab-timer" class="tab-pane w-full">
    <?php
    if (!($develuxsct_sale_start && $develuxsct_sale_end)): ?>
        <p class="w-full p-15">
            <?php esc_html_e('Add Sale price dates first to use countdown timer', 'devellux-sales-countdown-timer-builder'); ?>
        </p>
        <?php
        echo '</div>';
        return;
    endif;
    ?>
    <div class="flex flex-col">
        <?php
        echo wp_kses($develuxsct_renderer->render('tabs/timer_tab_fields',
            ['post' => $post, 'renderer' => $develuxsct_renderer]), $develuxsct_allowed_html);
        ?>
    </div>
</div>


