<?php
/**
 * Formats a field diff.
 *
 * @package EaLab\WP_Deployer
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Requires.
 */
require_once __DIR__ . '/field-name.php';

use EaLab\WP_Deployer\vendor\Ealab\Deployer\Exception\WpDeployException;

/**
 * Formats a field diff.
 *
 * @param array $context The context of this component.
 *
 * @return string Markup.
 *
 * @throws WpDeployException Cannot format the label.
 */
function deploy_sync_content__field_diff( array $context ): string {
	list (
		'full_field_name' => $full_field_name,
		'html_diff' => $html_diff ) = $context;

	$html = '<div class="deploy_sync_content__field_diff">';

	$html .= deploy_sync_content__field_name( $full_field_name, $context );

	$html .= $html_diff;

	$html .= '</div>';

	return $html;
}
