<?php
/**
 * What a screen says when there is nothing on it yet.
 *
 * One partial rather than four hand-written blocks, so they cannot drift into
 * four different tones — and so the shape stays the same one: what this is,
 * why it is empty, and the next thing to do where there is one.
 *
 * @package TextTango
 *
 * @var array<string, mixed> $args {
 *     @type string $title  The short line, in a heavier weight.
 *     @type string $lead   The explanation. Optional.
 *     @type string $action Label for the link. Optional.
 *     @type string $url    Where the link goes. Optional.
 * }
 */

declare( strict_types=1 );

defined( 'ABSPATH' ) || exit;

$texttango_lead   = trim( (string) ( $args['lead'] ?? '' ) );
$texttango_action = trim( (string) ( $args['action'] ?? '' ) );
$texttango_url    = trim( (string) ( $args['url'] ?? '' ) );
?>
<div class="tt-rounded-md tt-bg-slate-50 tt-px-6 tt-py-10 tt-text-center">
	<p class="tt-m-0 tt-text-sm tt-font-medium tt-text-slate-700">
		<?php echo esc_html( (string) ( $args['title'] ?? '' ) ); ?>
	</p>

	<?php if ( '' !== $texttango_lead ) : ?>
		<p class="tt-mx-auto tt-mb-0 tt-mt-2 tt-max-w-md tt-text-sm tt-leading-relaxed tt-text-slate-500">
			<?php echo esc_html( $texttango_lead ); ?>
		</p>
	<?php endif; ?>

	<?php if ( '' !== $texttango_action && '' !== $texttango_url ) : ?>
		<p class="tt-m-0 tt-mt-4">
			<a class="tt-btn tt-btn-secondary" href="<?php echo esc_url( $texttango_url ); ?>">
				<?php echo esc_html( $texttango_action ); ?>
			</a>
		</p>
	<?php endif; ?>
</div>
