<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; }
use Elementor\Widget_Base;
use Sifency\Classes\Sifency_Addons_Widget_Base;
use Sifency\Classes\Sifency_Themebuilder_Widget_Base;
use Elementor\Controls_Manager;
use Sifency\Traits\Sifency_Addons_Label_Content_Controls;
use Sifency\Traits\Sifency_Addons_TB_Separator_Content_Controls;
use Sifency\Traits\Render_Sifency_Addons_TB_Meta;
use Sifency\Traits\Sifency_Addons_Trio_Text_Style_Controls;
use Sifency\Traits\Sifency_Addons_Themebuilder_Controls;
class Sifency_Widget_Project_Complete_Date extends Sifency_Themebuilder_Widget_Base {
	use Sifency_Addons_Label_Content_Controls;
	use Sifency_Addons_TB_Separator_Content_Controls;
	use Render_Sifency_Addons_TB_Meta;
	use Sifency_Addons_Trio_Text_Style_Controls;
	use Sifency_Addons_Themebuilder_Controls;

	protected function get_allowed_template_types() {
		return 'portfolio';
	}
	public function __construct( $data = array(), $args = null ) {
		parent::__construct( $data, $args );
		$this->wg_config = array(
			'name'          => 'sifency-project-complete-date',
			'title'         => 'Project Complete Date',
			'icon'          => 'eicon-meta-data',
			'category'      => array( 'sifency-portfolio-components' ),
			'keywords'      => array( 'project', 'date', '', 'meta', 'dynamic', 'sifency' ),
			'style_depends' => array( 'sifency-typo-style' ),
		);}
	protected function register_controls() {
		$this->add_sifency_addons_themebuilder_controls(
			array(
				'show_placeholder'  => false,
				'show_date_section' => true,
			)
		);
	}
	protected function render_dom( array $context ) {
		$wrapper_id  = esc_attr( $context['dom_id'] );
		$settings    = $this->get_settings_for_display();
		$date_string = sifency_get_field( 'portfolio_completion_date' );
		$this->render_sifency_tb_data( $date_string, $settings, 'date' );
	}
}
