<?php
defined('ABSPATH') || exit;

// Add menu item
add_action('admin_menu', function() {
    add_menu_page(
        'CF7 Submissions',
        'CF7 Submissions',
        'manage_options',
        'cf7-submissions',
        'cf7_submissions_admin_page',
        'dashicons-email-alt',
        26
    );
});

function cf7_submissions_admin_page() {
    echo '<div class="wrap"><h1>Contact Form 7 Submissions</h1>';

    $list_table = new CF7_Submissions_List_Table();
    $list_table->prepare_items();

    $list_table->search_box('Search Submissions', 'cf7-submissions');

    echo '<form method="post">';
    $list_table->display();
    echo '</form>';

    echo '</div>';
}
