<?php
/**
 * NothingFound.
 *
 * @package MadeByAura\Prime\Customizer\Fields\Content
 * @author  MadeByAura.com
 */

namespace MadeByAura\Prime\Customizer\Fields\Content;

use MadeByAura\Prime\Customizer\Modules\Add;
use MadeByAura\Prime\Customizer\Modules\Value;
use MadeByAura\Prime\Helpers\SingletonTrait;

defined( 'ABSPATH' ) || die();

/**
 * NothingFound.
 */
class NothingFound {
	use SingletonTrait;

	/**
	 * Constructor.
	 */
	protected function __construct() {
		add_action( 'after_setup_theme', [ __CLASS__, 'add_section' ] );
	}

	/**
	 * Add section.
	 */
	public static function add_section() {
		$section  = 'nothing_found';
		$priority = 10;

		// Section.
		Add::section(
			$section,
			[
				'title'    => esc_attr__( 'Nothing found', 'aura-prime' ),
				'section'  => 'aura_section_content',
				'priority' => 0,
			],
		);

		// Minimum height.
		$id       = 'min_height';
		$priority = Add::field(
			$section,
			$id,
			$priority,
			[
				'label'   => esc_attr__( 'Minimum height', 'aura-prime' ),
				'type'    => 'dimension',
				'default' => Value::get_default( $section, $id ),
				'output'  => [
					[
						'element'  => '.aura-nothing-found--404',
						'property' => 'min-height',
					],
				],
			],
		);

		// Title.
		$id       = 'title_typography';
		$priority = Add::field(
			$section,
			$id,
			$priority,
			[
				'label'   => esc_attr__( 'Title', 'aura-prime' ),
				'type'    => 'typography',
				'default' => Value::get_default( $section, $id ),
				'output'  => [
					[
						'element' => '.aura-nothing-found__title',
					],
				],
			],
		);

		// Description.
		$id       = 'description_typography';
		$priority = Add::field(
			$section,
			$id,
			$priority,
			[
				'label'   => esc_attr__( 'Description', 'aura-prime' ),
				'type'    => 'typography',
				'default' => Value::get_default( $section, $id ),
				'output'  => [
					[
						'element' => '.aura-nothing-found__description',
					],
				],
			],
		);
	}
}
