<?php

Kirki::add_section( 'error_options', array(
	'title' => esc_html__( 'Error Page', 'newshit' ),
	'panel' => 'newshit_option_layout',
) );

new \Kirki\Field\Checkbox_Switch(
	[
		'settings' => 'error_breadcrumb',
		'label'    => esc_html__( 'Enable Breadcrumb', 'newshit' ),
		'section'  => 'error_options',
		'default'  => 'on',
		'choices'  => [
			'on'  => esc_html__( 'Enable', 'newshit' ),
			'off' => esc_html__( 'Disable', 'newshit' ),
		],
	]
);

new \Kirki\Field\Text(
	[
		'settings' => 'error_title',
		'label'    => esc_html__( 'Title', 'newshit' ),
		'section'  => 'error_options',
		'default'  => esc_html__( 'Oops! That page can&rsquo;t be found', 'newshit' ),
	]
);

new \Kirki\Field\Textarea(
	[
		'settings' => 'error_content',
		'label'    => esc_html__( 'Content', 'newshit' ),
		'section'  => 'error_options',
		'default'  => esc_html__( 'We are really sorry but the page you requested is missing.', 'newshit' ),
	]
);

new \Kirki\Field\Checkbox_Switch(
	[
		'settings' => 'error_btn_show',
		'label'    => esc_html__( 'Enable Button', 'newshit' ),
		'section'  => 'error_options',
		'default'  => 'on',
		'choices'  => [
			'on'  => esc_html__( 'Enable', 'newshit' ),
			'off' => esc_html__( 'Disable', 'newshit' ),
		],
	]
);

new \Kirki\Field\Text(
	[
		'settings'        => 'error_btn_text',
		'label'           => esc_html__( 'Button Text', 'newshit' ),
		'section'         => 'error_options',
		'default'         => esc_html__( 'Go Home', 'newshit' ),
		'active_callback' => [
			[
				'setting'  => 'error_btn_show',
				'operator' => '==',
				'value'    => true,
			],
		],
	]
);

new \Kirki\Field\Checkbox_Switch(
	[
		'settings' => 'error_image_show',
		'label'    => esc_html__( '404 Image', 'newshit' ),
		'section'  => 'error_options',
		'default'  => 'off',
		'choices'  => [
			'on'  => esc_html__( 'Enable', 'newshit' ),
			'off' => esc_html__( 'Disable', 'newshit' ),
		],
	]
);

new \Kirki\Field\Image(
	[
		'settings'        => 'error_image',
		'label'           => esc_html__( 'Upload Image', 'newshit' ),
		'section'         => 'error_options',
		'active_callback' => [
			[
				'setting'  => 'error_image_show',
				'operator' => '==',
				'value'    => true,
			],
		],
	]
);
