<?php

$this->start_controls_section(
    'content_section',
    [
        'label' => __('Content', 'ostech-addon'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
        'condition' => [
            'layout_type' => 'layout_one'
        ]
    ]
);


$layout_one_icon_box = new \Elementor\Repeater();

$layout_one_icon_box->add_control(
    'title',
    [
        'label' => __('Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => __('Book Appointment ', 'ostech-addon'),
        'label_block' => true,
    ]
);

ostech_elementor_heading_option($layout_one_icon_box, 'Title', 'h3', 'layout_one');

$layout_one_icon_box->add_control(
    'content',
    [
        'label' => __('Content', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'label_block' => true,
        'default' => __('Default Content', 'ostech-addon'),
    ]
);


$layout_one_icon_box->add_control(
    'icon',
    [
        'label' => __('Icon', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'icon-increment',
            'library' => 'custom-icon',
        ],
    ]
);

$this->add_control(
    'layout_one_icon_box',
    [
        'label' => __('Items', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $layout_one_icon_box->get_controls(),
        'prevent_empty' => false,
        'title_field' => '{{{ title }}}',
    ]
);

$this->end_controls_section();
