<?php
/**
 * Template part for displaying site footer
 *
 * @package errigal
 * @since 1.0.0
 */

defined( 'ABSPATH' ) || exit;

use Errigal\Constant\{
	Errigal_Component_Class as Component_Class,
	Errigal_Footer_Class as Footer_Class,
	Errigal_Html_Attr as Html_Attr,
	Errigal_Html_Option as Html_Option,
};
use Errigal\Shared\Errigal_Html_Builder as Html_Builder;

Html_Builder::create()->create_footer(
	array(
		Html_Option::ATTRS => array(
			Html_Attr::ID         => 'colophon',
			Html_Attr::CLASS_NAME => Footer_Class::SITE_FOOTER,
		),
	)
)->render_element(
	function ( $html_builder ) {
		if ( ! Html_Builder::is_html_builder( $html_builder ) ) {
			return;
		}

		$html_builder->create_div(
			array(
				Html_Option::ATTRS => array(
					Html_Attr::CLASS_NAME => Component_Class::CONTAINER,
				),
			)
		)->render_element(
			function ( $html_builder ) {
				if ( ! Html_Builder::is_html_builder( $html_builder ) ) {
					return;
				}

				$html_builder->create_div(
					array(
						Html_Option::ATTRS => array(
							Html_Attr::CLASS_NAME => array(
								Component_Class::ROW,
								Footer_Class::SITE_FOOTER_CONTENT,
							),
						),
					)
				)->render_element(
					function () {
						get_template_part( 'template-parts/component/footer/site-footer/content' );
					}
				);
			}
		);
	}
);
