<?php

namespace WPT\Cf7Divi\Divi5\Modules\ContactForm7Module;

if ( !defined( 'ABSPATH' ) ) {
    die( 'Direct access forbidden.' );
}

use ET\Builder\Packages\ModuleLibrary\ModuleRegistration;
use WPT\Cf7Divi\Divi5\Modules\ContactForm7Module\ContactForm7ModuleTraits;
use ET\Builder\Framework\DependencyManagement\Interfaces\DependencyInterface;


class ContactForm7Module implements DependencyInterface
{

    use ContactForm7ModuleTraits\RenderCallbackTrait;
    use ContactForm7ModuleTraits\ModuleClassnamesTrait;
    use ContactForm7ModuleTraits\ModuleStylesTrait;
    use ContactForm7ModuleTraits\ModuleScriptDataTrait;

    /**
     * Load the module
     */
    public function load()
    {
        $container			   = wpt_divi_contact_form7_container();
        $module_json_folder_path = $container['plugin_dir'] . '/divi-5/visual-builder/src/modules/contact-form-7';

        add_action(
            'init',
            function () use ( $module_json_folder_path ) {
                ModuleRegistration::register_module(
                    $module_json_folder_path,
                    [
                        'render_callback' => [ContactForm7Module::class, 'render_callback'],
                    ]
                );
            }
        );
    }
}