<?php
/**
 * Template part for displaying site header search
 *
 * @package errigal
 * @since 1.2.0
 */

defined( 'ABSPATH' ) || exit;

use Errigal\Constant\{
	Errigal_Component_Class as Component_Class,
	Errigal_Header_Class as Header_Class,
	Errigal_Html_Attr as Html_Attr,
	Errigal_Html_Option as Html_Option,
	Errigal_Navigation_Id as Navigation_Id,
};
use Errigal\Shared\Errigal_Html_Builder as Html_Builder;

Html_Builder::create()->create_div(
	array(
		Html_Option::ATTRS => array(
			Html_Attr::ID          => Navigation_Id::SITE_HEADER_SEARCH,
			Html_Attr::CLASS_NAME  => array(
				Header_Class::SITE_HEADER_SEARCH,
				Component_Class::COL_12,
			),
			Html_Attr::ARIA_HIDDEN => true,
		),
	)
)->render_element(
	function () {
		get_search_form();
		get_template_part( 'template-parts/component/search/close-search-button' );
	}
);
