<?php

namespace Layerdrops\Ostech\Widgets;


class ServiceDetails extends \Elementor\Widget_Base
{
	public function get_name()
	{
		return 'ostech-service-details';
	}

	public function get_title()
	{
		return __('Service Details', 'ostech-addon');
	}

	public function get_icon()
	{
		return 'eicon-cogs';
	}

	public function get_categories()
	{
		return ['ostech-category'];
	}

	protected function register_controls()
	{
		$this->start_controls_section(
			'layout_section',
			[
				'label' => __('Layout', 'ostech-addon'),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
			]
		);

		$this->add_control(
			'layout_type',
			[
				'label' => __('Select Layout', 'ostech-addon'),
				'type' => \Elementor\Controls_Manager::SELECT2,
				'default' => 'layout_one',
				'options' => [
					'layout_one' => __('Layout One (Image)', 'ostech-addon'),
				]
			]
		);

		$this->end_controls_section();

		include  ostech_get_elementor_option('service-details-one-option.php');

		//style
		$this->start_controls_section(
			'general_style',
			[
				'label' => esc_html__('Style Options', 'ostech-addon'),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE,
			]
		);

		ostech_elementor_general_style_options($this, 'Section Title', '{{WRAPPER}} .service-details__sub-title', ['layout_one']);
		ostech_elementor_general_style_options($this, 'Title', '{{WRAPPER}} .service-details__post__title a', ['layout_one']);
		ostech_elementor_general_style_options($this, 'Date', '{{WRAPPER}} .service-details__post__date', ['layout_one']);

		$this->end_controls_section();
	}

	protected function render()
	{
		$settings = $this->get_settings_for_display();
		include ostech_get_template('service-details-one.php');
	}
}
