<?php

declare(strict_types=1);

namespace BookiFlex\Core\Util;
use Carbon_Fields\Field;

defined( 'ABSPATH' ) || exit;

class ProFeature
{
	public static function notice(string $id, string $message, string $url = 'https://bookiflex.com/pro')
	{
		return Field::make('html', $id)
		            ->set_html(sprintf(
			            '<div class="crb-pro-notice">
                    <strong class="crb-pro-title">%s</strong> %s<br>
                    <a href="%s" target="_blank" class="crb-pro-link">%s</a>
                </div>',
			            __('Available in BookiFlex Pro:', 'bookiflex'),
			            $message,
			            self::withUtm($id, $url),
			            __('Learn more →', 'bookiflex')
		            ));
	}

	public static function withUtm(string $id, string $url = 'https://bookiflex.com/pro'): string
	{
		return sprintf('%s?utm_source=%s&utm_medium=%s&utm_campaign=%s', $url, 'free_plugin', 'notification', $id);
	}
}
