<?php 
/**
 * MAIN NEWS SECTION SETTINGS
 */
Kirki::add_section( 'front_newsletter_section', array(
	'title'    => esc_html__( 'Newsletter Section', 'newshit' ),
	'panel'    => 'newshit_front_page_options',
) );

Kirki::add_field( 'theme_config', [
	'type'        => 'switch',
	'settings'    => 'enable_newsletter_section',
	'label'       => esc_html__( 'Enable Newsletter Section', 'newshit' ),
	'section'     => 'front_newsletter_section',
	'default'     => 'off',
	'choices'     => [
		'on'  => esc_html__( 'Enable', 'newshit' ),
		'off' => esc_html__( 'Disable', 'newshit' ),
	],
] );

new \Kirki\Field\Textarea(
	[
		'settings'    => 'newsletter_content',
		'label'       => esc_html__( 'Newsletter Content', 'newshit' ),
		'section'     => 'front_newsletter_section',
		'default'     => esc_html__( 'Lets Join With Our Subscriber NewsHit', 'newshit' ),
        'active_callback' => [
            [
                'setting'  => 'enable_newsletter_section',
                'operator' => '===',
                'value'    => true,
            ]
        ],
		'partial_refresh'    => [
			'newsletter_content_refresh' => [
				'selector'        => '.newshit-newsletter-box',
				'render_callback' => 'newshit_customizer_quickedit',
			],
		],
	]
);

new \Kirki\Field\Text(
	[
		'settings' => 'newsletter_shortcode',
		'label'    => esc_html__( 'Shortcode', 'newshit' ),
		'section'  => 'front_newsletter_section',
		'active_callback' => [
            [
                'setting'  => 'enable_newsletter_section',
                'operator' => '===',
                'value'    => true,
            ]
        ],
	]
);