
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php

namespace GigaAI\Logger;

use GigaAI\Component;
use GigaAI\Core\Logger as CoreLogger;

class Logger
{
    /**
     * Constructor will create the menu item
     */
    public function __construct()
    {
        add_action('admin_menu', [$this, 'settings_page']);
    }
    
    /**
     * Menu item will allow us to load the page to display the table
     */
    public function settings_page()
    {
        add_submenu_page('giga',
            __('Logger', 'giga-messenger-bots'),
            __('Logger', 'giga-messenger-bots'),
            'manage_options',
            'logger',
            [$this, 'render']
        );
    }
    
    /**
     * Display the list table page
     *
     * @return Void
     */
    public function render()
    {
        $table = new \Logger_List_Table;
        
        $table->prepare_items();
        ?>
        <div class="wrap">
            <h1><?php _e('Logger', 'giga-messenger-bots'); ?></h1>
            <?php $table->display(); ?>
        </div>
        <?php
    }
}

new Logger;