<?php

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

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

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

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

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

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

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

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