<?php

namespace MODELORA\Elementor;

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

class Widget
{
    public function register(): void
    {
        add_action('elementor/widgets/register', [$this, 'register_widget']);
    }

    public function register_widget($widgets_manager): void
    {
        if (! class_exists('\\Elementor\\Widget_Base')) {
            return;
        }

        require_once MODELORA_PLUGIN_DIR . 'includes/Elementor/WidgetModelViewer.php';
        $widgets_manager->register(new \MODELORA\Elementor\WidgetModelViewer());
    }
}
