<?php
/**
 * Alert / notice partial.
 *
 * @package MonitorCat
 *
 * @var string $type    Alert type: 'success', 'warning', 'error', or 'info'.
 * @var string $message Alert message content.
 */

defined( 'ABSPATH' ) || exit;

$monitorcat_alert_type = isset( $type ) ? $type : 'info';
$monitorcat_alert_msg  = isset( $message ) ? $message : '';

$monitorcat_icon_map = array(
	'success' => 'dashicons-yes-alt',
	'warning' => 'dashicons-warning',
	'error'   => 'dashicons-dismiss',
	'info'    => 'dashicons-info',
);

$monitorcat_alert_icon = isset( $monitorcat_icon_map[ $monitorcat_alert_type ] ) ? $monitorcat_icon_map[ $monitorcat_alert_type ] : 'dashicons-info';
?>

<div class="mc-alert mc-alert-<?php echo esc_attr( $monitorcat_alert_type ); ?>" role="alert">
	<span class="mc-alert-icon dashicons <?php echo esc_attr( $monitorcat_alert_icon ); ?>"></span>
	<div class="mc-alert-content">
		<?php echo wp_kses_post( $monitorcat_alert_msg ); ?>
	</div>
</div>
