<?php
/**
 * Template part for displaying welcome notice
 *
 * @package errigal
 * @since 1.0.4
 */

defined( 'ABSPATH' ) || exit;

use Errigal\Admin\{
	Errigal_Notice as Notice,
	Errigal_Notice_Item as Notice_Item,
};
use Errigal\Constant\Errigal_Template_Part as Template_Part;
use Errigal\Shared\Errigal_Theme_Info as Theme_Info;

get_template_part(
	'template-parts/component/admin/notice',
	null,
	array(
		Notice::ID                     => 'errigal-welcome-notice',
		Notice::TITLE                  => esc_html(
			sprintf(
				/* translators: %s: Name of current theme. */
				__( 'Welcome to %s', 'errigal' ),
				Theme_Info::get_theme_name()
			)
		),
		/**
		 * Renders admin notice content.
		 *
		 * @since 1.2.0
		 *
		 * @return void
		 */
		Template_Part::RENDER_CALLBACK => function () {
			get_template_part(
				'template-parts/component/admin/notice/content',
				null,
				array(
					Notice::SECTION_NEW => array(
						Notice_Item::get_custom_breadcrumb(),
					),
					Notice::SECTION_TRY => array(
						Notice_Item::get_profile_widget(),
						Notice_Item::get_custom_heading_style(),
					),
				)
			);
		},
	)
);
