<?php

class KLCNN_Admin
{
  public function __construct()
  {
    add_action('admin_enqueue_scripts', [$this, 'enqueue_admin_scripts']);
  }

  public function enqueue_admin_scripts()
  {
    $screen = get_current_screen();
    if ($screen && $screen->id === 'woocommerce_page_easyconnect-for-kaufland') {
      wp_enqueue_script(
        'klcnn-admin',
        KLCNN_URL . 'dist/js/admin.js',
        ['wp-api'],
        KLCNN_VERSION,
        true
      );
    }
  }
}
