<?php

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

$counter_list = new \Elementor\Repeater();

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

$counter_list->add_control(
    'number',
    [
        'label' => __('Number', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'placeholder' => __('Add Number', 'ostech-addon'),
        'default' => __('680', 'ostech-addon'),
        'label_block' => true
    ]
);
$counter_list->add_control(
    'counter_after',
    [
        'label' => __('Counter After', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'placeholder' => __('Counter After', 'ostech-addon'),
        'default' => __('%', 'ostech-addon'),
        'label_block' => true
    ]
);

$counter_list->add_control(
    'title',
    [
        'label' => __('Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '2',
        'placeholder' => __('Add title', 'ostech-addon'),
        'default' => __('Projects Completed', 'ostech-addon'),
    ]
);
$this->add_control(
    'counter_list',
    [
        'label' => __('Count Lists', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $counter_list->get_controls(),
        'prevent_empty' => false,
        'title_field' => '{{{ title }}}',
    ]
);

$this->end_controls_section();
