<?php
namespace Booktics\Shortcode;

/**
 * Category shortcode class
 */
class Category_Shortcode {
    /**
     * Constructor for category shortcode
     *
     * @return  void
     */
    public function __construct() {
        add_shortcode( 'booktics_category_form', array( $this, 'render_category_form' ) );
    }


    /**
     * Render category form
     *
     * @param   array  $attributes
     *
     * @return  string
     */
    public function render_category_form( $attributes ) {
        wp_enqueue_style( 'booktics-vendor' );
        wp_enqueue_style( 'booktics-frontend' );

        wp_enqueue_script( 'booktics-packages' );
        wp_enqueue_script( 'booktics-frontend-scripts' );
        wp_enqueue_script( 'booktics-flatpickr-scripts' );
        
        do_action( 'booktics_before_rendering_category_form_shortcode' );

        return '<div id="booktics-category-form"></div>';
    }
}
