<?php

namespace DaftPlug\Generatify\Features\SmartSuggestions;

use DaftPlug\Generatify\Helpers\Utils;

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

class SmartCompose
{
  public function __construct()
  {
    add_action('wp_enqueue_scripts', [$this, 'loadSmartComposeAssets']);
  }

  public function loadSmartComposeAssets()
  {
    if (Utils::getSetting('aiSmartCompose') !== 'on') {
      return;
    }

    wp_enqueue_script('generatify-smart-compose', plugins_url('assets/js/smartCompose.js', GENERATIFY_FILE), [], GENERATIFY_VERSION, true);
  }
}
