<?php

namespace GymBuilder\Inc\Controllers\Admin\Notice;

use GymBuilder\Inc\Abstracts\Discount;
use GymBuilder\Inc\Traits\SingleTonTrait;

if ( ! defined( 'ABSPATH' ) ) {
    exit( 'This script cannot be accessed directly.' );
}
class BlockToolsNotice extends Discount {
    use SingleTonTrait;

    private $is_active;

    public function __construct() {
        $this->is_active = $this->is_block_tools_active();
        $GLOBALS['block_tools_notice'] = $this->is_active;
        parent::__construct();
    }

    private function is_block_tools_active(): bool {
        $active_plugins = (array) get_option( 'active_plugins', [] );
        return in_array( 'gym-builder-block-tools/gym-builder-block-tools.php', $active_plugins );
    }

    public function the_options(): array {
        return [
            'option_name'    => 'block-tools-notice',
            'global_check'   => $this->is_active,
            'plugin_name'    => 'Unlock Gutenberg Block Tools',
            'notice_for'     => 'Build Your Gym Site in Minutes!',
            'download_link'  => 'https://wpdreamers.com/',
            'start_date'     => '10 December 2023',
            'end_date'       => '30 January 2029',
            'notice_message' => 'Get started instantly with pre-built gym templates! Import Yoga, Fitness, Gym, Boxing, Karate, or Swimming demo with one click. Beautiful layouts, custom blocks, and professional designs — ready in seconds.',
        ];
    }
}
