<?php
namespace NCPC;

/**
 * public Pages Handler
 */
class NCPC_Public
{

    public function __construct()
    {
        $this->render_public();
    }

    /**
     * Render public app
     *
     * @param  array $atts
     * @param  string $content
     *
     * @return string
     */
    public function render_public($content = '')
    {
        wp_enqueue_style(
            'ncpc-free-review',
            NCPC_ASSETS . '/utilities/ncpc-free-review.css',
            false,
            NCPC_VERSION
        );
        wp_enqueue_script(
            'ncpc-free-promo',
            NCPC_ASSETS . '/utilities/ncpc-free-promo.js',
            ['jquery'],
            '1.0.0',
            true
        );

        // Localiser les données
        wp_localize_script('ncpc-free-promo', 'ncpcFreePromoData', [
            'nonce' => wp_create_nonce('ncpc_free_promo_nonce'),
            'ajaxUrl' => admin_url('admin-ajax.php'),
            'strings' => [
                'thanks' => __('Thank you for your interest!', 'neon-channel-product-customizer-free'),
                'dismissed' => __('Hidden promotion', 'neon-channel-product-customizer-free')
            ]
        ]);
        wp_enqueue_style('ncpc-style', NCPC_ASSETS . '/css/style.css', array(), NCPC_VERSION, 'all');
        wp_enqueue_style('ncpc-omodal-css', NCPC_ASSETS . '/utilities/modal.min.css', array(), NCPC_VERSION, 'all');
        wp_enqueue_script('ncpc-omodal', NCPC_ASSETS . '/utilities/modal.min.js', array(), NCPC_VERSION, true);
        wp_enqueue_script('ncpc-proncduct-design', NCPC_ASSETS . '/utilities/product-design.js', array('jquery'), NCPC_VERSION, true);
        return $content;
    }
}
